Results 1 to 7 of 7
  1. #1
    BiotechAccessUser is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    4

    How to create a "living form"

    Hi,



    I am new to Access and may be missing an obvious solution. I have a sample code field for data entry on a form, which is in a dropdown list. I want the first form the user sees to have just the sample id, the sample code (date, initials etc), but once they select the sample code, depending on the code, I want other fields to become visible. How do I do this?

    Thanks!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    BiotechAccessUser is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    4
    Yes! So do I just try and put this into the Macro part of Access? I have never done this before. I will try and ask if I have questions....

    Quote Originally Posted by pbaldy View Post

  4. #4
    BiotechAccessUser is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    4
    Hi,

    I tried the following code:

    Dim SampleCode As AcControlType
    Dim pH As AcControlType
    If SampleCode = "LLS" Then
    pH.Visible = True
    Else: pH.Visible = False
    End If

    I can't seem to dim the field as a field....is AcControl not right? also what if my field name has a space in it?

    Thanks!

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Why don't you simply refer to them as I did in the link? Also, I'm not personally a fan of mixing the one-line and block formats of an If/Then/Else.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    BiotechAccessUser is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Sep 2013
    Posts
    4
    Thanks, but what do I do with a control name that has a space in it (like "Sample Code")? And I don't know the difference between one-line and block formats, I'll have to look it up! I'm a beginner self taught coder (if you can even call me that). Thanks!

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If you have inadvisable spaces in your names, they need to be [bracketed].
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 08-19-2013, 03:00 PM
  2. Replies: 2
    Last Post: 08-05-2013, 06:36 PM
  3. Replies: 3
    Last Post: 11-27-2012, 07:20 AM
  4. Replies: 4
    Last Post: 04-26-2012, 08:25 PM
  5. Replies: 11
    Last Post: 03-29-2012, 02:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums