Results 1 to 3 of 3

Thread: Add record variable?

  1. #1

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    This is what I want to do, and logically, this would seem to work, but it doesn't. I want the first field name to be a variable.

    rsd.AddNew

    Name = ("rsd!" + strComboBox)

    Name = strComboContents
    rsd!contact = frmForm!cboContact.Text
    rsd!Phone = frmForm!mskPhone
    rsd!extension = frmForm!txtExtension
    rsd!fax = frmForm!mskFax
    rsd!Email = frmForm!txtEmail

    rsd.Update

    Any suggestions on how to do this?
    Normal is boring...

    smh

  2. #2
    New Member
    Join Date
    Mar 2001
    Posts
    12

    Variable Field Name

    How about this?

    Dim TempStr as string


    Tempstr = strComboBox

    rsd.fields(Tempstr) = strComboContents



    I'm not sure why your trying to make the recordset
    a variable...I'm guessing your trying to make the field
    name a variable...

    Hope this helps...

  3. #3

    Thread Starter
    Addicted Member smh's Avatar
    Join Date
    Oct 2000
    Location
    South Dakota, USA
    Posts
    249
    I tried something similar to that, and it's actually looking for the variable name as the field. I just ended up using a case statement instead of using a variable.

    Thanks anyway!
    Normal is boring...

    smh

Posting Permissions

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



Click Here to Expand Forum to Full Width