Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2002
    Posts
    173

    Unanswered: code checked from combo

    I have the following piece of code:

    With doc

    .FormFields("fldaddress").Result = Nz(Me!por_Address1)
    .FormFields("fldcity").Result = Nz(Me!por_City)
    .FormFields("fldstate").Result = Nz(Me!por_State)
    .FormFields("fldzip").Result = Nz(Me!por_Zip)

    End With


    Is it possible to have this code stored in a table then by selecting the appropriate item in a combo box in a form this code will be inserted. I'm using this code along with some other code in a couple of different forms. Depending on what form is picked the appropriate statements above will be selected. I've gotten it to work on some other bits of code but I'm not sure how to reference it this time. Do I have to setup a "Dim"?

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    you can store "code" in a table and access it and incorporate it into e.g. SQL string.

    i didn't check your exact question, but is it worth the overhead compared with a simple Select Case?

    izy

  3. #3
    Join Date
    Jun 2002
    Posts
    173
    I have about 30 pre-printed forms in Word that are going to be linked to Access. Mail merge won't work in this situation so I have a combo box to select which form I want to open. One of the columns on the combo box will list the specific code needed for each form. If it's not possible then I guess I'll have to setup a bunch of "if then" statements in the form's code.

Posting Permissions

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