Results 1 to 7 of 7
  1. #1
    SpdRacerX is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    40

    Autofilling when New Record Created from Form

    I'm new to Access. I'm have a Form with Sub-Forms. The first tab of the form is a general page with patient demographics (from a query). The second tab is a subform which has the data from an admission table. What I want to make sure is that users don't make too many mistakes. I want the data to autopopulate when a new record is created in the subform with the correct data from the general page.



    i.e. the name of the patient in the new admission record will automatically equal the demographic page. right now it is a drop-down with many names.

    Any suggestions?

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Take a look at the tutorial on this page - it might give you what you need:
    http://www.baldyweb.com/wherecondition.htm

    Let us know if that does not help you.

  3. #3
    SpdRacerX is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    40
    Is the code put into VB with the Expression Builder?

    I am new to Access, but do have experience with Excel.

  4. #4
    SpdRacerX is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    40
    Using the Code here is what I have:

    DoCmd.OpenForm "Total_Flags", , , "Veteran = '" & Me.[Customer Name] & "'"

    Once the Subform is entered however, an error message appears stating the form name is mispelled or doesn't exist?

    Am I using the correct name of the subform? I used the name from the Properties.

  5. #5
    SpdRacerX is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Jan 2012
    Posts
    40
    When I click on the patient's name field, it still has a list of every patient. I just want the patient's name who is on the demographic page to be in the listbox.

  6. #6
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    I'm afraid I have not worked extensively with Tab controls - but you could try looking here for information:
    http://msdn.microsoft.com/en-us/libr...ffice.12).aspx

    Let me know if that page helps you . . . [I might need it one day]!
    It looks pretty helpful & hope it helps you!!


  7. #7
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Hmm . . . that's a different issue now.
    Is your 'list' in a 'List Box' . . . or a 'Combo Box'?

    There may be more than one way of limiting what shows in that list - but I think what you will need to do is change the 'Record Source' . . . or 'Row Source' for that control on the second Tab.
    You can do that in VBA code - but you might also be able to do it in the Property Sheet for the control that contains that list.
    Do a Search for 'ms access change List Box row source' . . . [or ComboBox].
    I'll try & look at this again when I have a little more time!!
    All the bset!

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

Similar Threads

  1. Replies: 3
    Last Post: 01-24-2012, 02:44 AM
  2. Code to display latest record number field created?
    By rowardHoark in forum Programming
    Replies: 1
    Last Post: 01-31-2011, 08:03 AM
  3. Replies: 9
    Last Post: 01-06-2011, 01:22 PM
  4. Who created new record
    By ducecoop in forum Access
    Replies: 10
    Last Post: 10-28-2010, 02:50 PM
  5. Replies: 1
    Last Post: 09-21-2010, 09:49 AM

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