Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316

    Unanswered: Really simple VB question

    How can I concatenate field references with variables? I have the following:

    Code:
    If Not IsNull([txt & lngPackNo]) Then Exit Sub
    I'm using lngPackNo in an incremental loop, with each loop referring to the next textbox (each textbox is called txt1, txt2, etc.). I also tried the following, but to no avail:

    Code:
    If Not IsNull(txt & lngPackNo) Then Exit Sub
    Can anyone provide the correct method? Many thanks in advance.

  2. #2
    Join Date
    Dec 2002
    Location
    Glasgow, UK
    Posts
    100
    I'm assuming you are referencing a form:

    If isnull(me.txt & me.lngPackNo) = true then
    exit sub
    end if
    Access XP & WinXP Pro

  3. #3
    Join Date
    Jul 2002
    Location
    Island of Dots
    Posts
    316
    I am referencing a form, but lngPackNo is a Long variable. I also tried:

    Code:
    If Not IsNull(Me.txt & lngPackNo) Then Exit Sub
    But that doesn't work either. I get the following compile error:

    Compile error:

    Method or data member not found

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •