Recent content by barboza

  1. B

    Text file Import: only 25 rows available

    There are several pieces of data that need to be extracted from the text file. I like the idea of reading the entire file into a table, then manipulating the data. Thanks to all of you that took the time to respond. Much appreciated!
  2. B

    Text file Import: only 25 rows available

    We are trying to import a text file. We are having two problems. First a little history about the text file: The text file contains results of a lab test. The data of interest does not appear before row 50 of the text file. The text import wizard in access does not show any rows after row 25...
  3. B

    use variable as reference in vba select statement

    No Single quotes - Doesn't work Here is the code as edited to remove single quotes: Set rst = dbs.OpenRecordset("Select " & strTest & " from Custody where LABID = '" & Me.txtLabID & "' AND " & strTest & " = '" & Me.txtMethod & "';") If I knew how to make the value appear in a MsgBox, I...
  4. B

    use variable as reference in vba select statement

    Hi PB, Here is the line of code after editing. Set rst = dbs.OpenRecordset("Select '" & strTest & "' from Custody where LABID = '" & Me.txtLabID & "' AND '" & strTest & "' = '" & Me.txtMethod & "';")
  5. B

    use variable as reference in vba select statement

    If I take the existing select line and put it in a MsgBox, the only part that is evaluated showing quotes are the form references. Just for kicks, I edited the line so that the variable was treated the same way as the from references - didn't help. The form references show the values in the form...
  6. B

    use variable as reference in vba select statement

    I am trying to use the variable strTest as a variable in the select statement below. The fields in the custody database contain F8 thru F34. Private Sub txtMethod_BeforeUpdate(Cancel As Integer) strA = 8 Do While strA < 35 strTest = "F" + strA Set dbs = CurrentDb Set rst =...
  7. B

    Pass a variable from form code to vba macro code.

    How can one pass a variable form form code to macro code. StrA is a variable with the value of 8 used in the vba code of a form - frmCustody We have a macro called Test how can macro test run the line: MsgBox strA and have the value 8 appear in the message box. Thanks, B
  8. B

    Changing form values from a macro

    Many Thanks Thanks Bob. Once again, you are right on the money!
  9. B

    Changing form values from a macro

    I have written the following macro that is in module 1. Sub Test() DoCmd.SelectObject acForm, "frmCustody" frmCustody.Me.Controls("F9").Value = "Ag" End Sub I get the following error: Object required. Any ideas how to get the value to show up in the form when the macro runs?? Thanks, B
  10. B

    Punctuation Aggravation

    Simplest Solution Set rst = dbs.OpenRecordset("SELECT LocationName FROM PWS WHERE LocationNumber='" & Me.LocationNumber & "' AND PWSName='" & Me.PWSName & "';") Thanks to all for your help. The code above works, and is easiest for me to grasp. Thanks again to all!!
  11. B

    Punctuation Aggravation

    Punctuation Problems Location number is actually a text field - there are some characters in a few of the location numbers. If you look at the first line of code - it works. In the second line I am trying to select based on two criteria: the location number AND the location name - both text...
  12. B

    Punctuation Aggravation

    It took forever to get the following line to work in VBA: Set rst = dbs.OpenRecordset("Select [LocationName] from PWS where [LocationNumber] = '" & Me.LocationNumber & "';") Now I am trying to get the following line of code to run with no success: Set rst = dbs.OpenRecordset("Select...
  13. B

    Concatenation of field name

    Concatenation Thank you Hi Bob, Thanks for the reply. I can't wait to get home and give it a shot. I have a feeling that the snippet you sent will do the job. Thanks again. BB
  14. B

    Concatenation of field name

    Concat cont'd We are an environmental testing lab. We enter samples into a table called Custody using a form - frmCustody. The form has more than 20 text boxes. Each text box is from a field in the Custody table. The form has text boxes F8 thru F28. When using the form we enter lab tests...
  15. B

    Concatenation of field name

    Correction to previous reply Private Sub cmdContinue_Click() strA = "8" Do While "Me.F" & strA <> "" MsgBox "Me.F" & strA strA= strA +1 End The MsgBox displays Me.F8 not A thanks
Back
Top Bottom