• WSdazednconfused

    WSdazednconfused

    @wsdazednconfused

    Viewing 15 replies - 31 through 45 (of 242 total)
    Author
    Replies
    • in reply to: SQL not populateing recordset in code (Access 2000) #875135

      Hope a zip file is OK?

    • in reply to: SQL not populateing recordset in code (Access 2000) #875130

      Thanks for the replies.

      OK, i’ve taken out the spaces.

      I then did the immediate window bit, thanks that’s going to be a useful tip

      Pasted the code into the Query SQL window, nothing is returned (I was expecting this but at least I now KNOW). I then had a quick ‘play’ with the Query in Design view and it returned the correct results. On viewing it in SQL it now looks like this: –

      SELECT *
      FROM PrimaryDataTbl
      WHERE (((PrimaryDataTbl.DateReceived) Between #1/1/2000# And #9/1/2004#) AND ((PrimaryDataTbl.VendorNumber)=17999));

      However, if I try that in my VBA it doesn’t like it at all, not that I really expected it to, but desperation drives you to wierd things….

      I then tried defining my fields in the query (PrimaryDataTbl.FieldName) to see if that helped, still no luck.

      So, is there something in my SQL statement that is causing the problem? I could create a Query and use QueryDefs, but that seems to be overkill for something this simple.

      I’ll look into stripping the database out to get it to < 100k.

      Thanks again.

      Ian

    • in reply to: SQL not populateing recordset in code (Access 2000) #875131

      Thanks for the replies.

      OK, i’ve taken out the spaces.

      I then did the immediate window bit, thanks that’s going to be a useful tip

      Pasted the code into the Query SQL window, nothing is returned (I was expecting this but at least I now KNOW). I then had a quick ‘play’ with the Query in Design view and it returned the correct results. On viewing it in SQL it now looks like this: –

      SELECT *
      FROM PrimaryDataTbl
      WHERE (((PrimaryDataTbl.DateReceived) Between #1/1/2000# And #9/1/2004#) AND ((PrimaryDataTbl.VendorNumber)=17999));

      However, if I try that in my VBA it doesn’t like it at all, not that I really expected it to, but desperation drives you to wierd things….

      I then tried defining my fields in the query (PrimaryDataTbl.FieldName) to see if that helped, still no luck.

      So, is there something in my SQL statement that is causing the problem? I could create a Query and use QueryDefs, but that seems to be overkill for something this simple.

      I’ll look into stripping the database out to get it to < 100k.

      Thanks again.

      Ian

    • in reply to: Syntax error (missing operator) (Access 2k) #874702

      Francois

      As yet I don’t what’s different between your SQL string and mine, but whatever it is it works hailpraise another learning opportunity provided by the good folks of Woody’s lounge

      cheers

      Thanks

      Ian

    • in reply to: Syntax error (missing operator) (Access 2k) #874703

      Francois

      As yet I don’t what’s different between your SQL string and mine, but whatever it is it works hailpraise another learning opportunity provided by the good folks of Woody’s lounge

      cheers

      Thanks

      Ian

    • in reply to: Adding record to a temprorary recordset in code (Access 2k) #872119

      Arrays look like they might be my answer, now how would I refer to the data in the array? With a recordset I can use RST!ItemName and loop through it using the MoveNext instruction. Looking at the Using Arrays help section there are not hints on how to do the same, getting data in appears to be easy enough even for me to manage

      I’ll keep reading, but if there’s any easy way, send it my way please

      Thanks

      Ian

    • in reply to: Adding record to a temprorary recordset in code (Access 2k) #872120

      Arrays look like they might be my answer, now how would I refer to the data in the array? With a recordset I can use RST!ItemName and loop through it using the MoveNext instruction. Looking at the Using Arrays help section there are not hints on how to do the same, getting data in appears to be easy enough even for me to manage

      I’ll keep reading, but if there’s any easy way, send it my way please

      Thanks

      Ian

    • in reply to: Adding record to a temprorary recordset in code (Access 2k) #872067

      Well, the demo looks nice, however, it’s taken me a while to gain any level of confidence in DAO, so moving to ADO is not something I’m in a hurry to do…

      I don’t want to keep the data any longer than the code is running for, if I can’t do this purely in VBA, can I create a new table, populate it with the file name, then delete it after I’ve used the data? Or is this going to be more difficult than learning the dark arts of ADO???

      Thanks

      Ian

    • in reply to: Adding record to a temprorary recordset in code (Access 2k) #872068

      Well, the demo looks nice, however, it’s taken me a while to gain any level of confidence in DAO, so moving to ADO is not something I’m in a hurry to do…

      I don’t want to keep the data any longer than the code is running for, if I can’t do this purely in VBA, can I create a new table, populate it with the file name, then delete it after I’ve used the data? Or is this going to be more difficult than learning the dark arts of ADO???

      Thanks

      Ian

    • in reply to: Averaging (2000) #872003

      I just tried this simple code in the on gotfocus event, you can use it in other ways.

      Dim strVar As String
      Dim strOutput As String

      strVar = 0

      If Me.Text0 0 Then
      strVar = strVar + 1
      End If
      If Me.Text2 0 Then
      strVar = strVar + 1
      End If
      If Me.Text4 0 Then
      strVar = strVar + 1
      End If
      If Me.Text6 0 Then
      strVar = strVar + 1
      End If

      strOutput = (Me.Text0.Value + Me.Text2.Value + Me.Text4.Value + Me.Text6.Value) / strVar

      Me.Text8 = strOutput

      The text boxes just hold values, text8 give the average when it gets the focus.

    • in reply to: Averaging (2000) #872004

      I just tried this simple code in the on gotfocus event, you can use it in other ways.

      Dim strVar As String
      Dim strOutput As String

      strVar = 0

      If Me.Text0 0 Then
      strVar = strVar + 1
      End If
      If Me.Text2 0 Then
      strVar = strVar + 1
      End If
      If Me.Text4 0 Then
      strVar = strVar + 1
      End If
      If Me.Text6 0 Then
      strVar = strVar + 1
      End If

      strOutput = (Me.Text0.Value + Me.Text2.Value + Me.Text4.Value + Me.Text6.Value) / strVar

      Me.Text8 = strOutput

      The text boxes just hold values, text8 give the average when it gets the focus.

    • in reply to: VBA Editor problems (Access 2k Win 2k) #862872

      Hans

      Thanks, this worked, any idea why it worked?

      Ian

    • in reply to: VBA Editor problems (Access 2k Win 2k) #862873

      Hans

      Thanks, this worked, any idea why it worked?

      Ian

    • in reply to: Access or Excel? (2000) #862803

      Hi

      You can export data to Excel, from Access, in a number of ways, transferspreadsheet, DoCmd.OutputTo, or automation. Which way you do depends on exactly how you want to manipulate the data as it leaves Access.

      Also, why use Excel and Access? Why not just allow the user to select specific data for viewing through the Access database?

      Ian

    • in reply to: Access or Excel? (2000) #862802

      Hi

      You can export data to Excel, from Access, in a number of ways, transferspreadsheet, DoCmd.OutputTo, or automation. Which way you do depends on exactly how you want to manipulate the data as it leaves Access.

      Also, why use Excel and Access? Why not just allow the user to select specific data for viewing through the Access database?

      Ian

    Viewing 15 replies - 31 through 45 (of 242 total)