Results 1 to 4 of 4
  1. #1
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16

    Inherited database - macros don't work on new page

    I inherited a database and have been trying to update it, with little success.

    The database has a main form with a form header, and then several pages, designed as subforms, that sit within that main form. In the main form header is a command button that lets the user search for an ID, and then once the ID is selected, a macro populates the different pages with the fields based on that ID. (Think looking up medical patients with an ID and the different pages referring to different aspects of that patient's health, that then get filled in when the patient is selected).

    I had to create some new pages for this database, and the command/macro that populates fields does not work on pages that I added.



    I am following the same format/properties for the patientID that seem to be in place for the existing pages (its a text box with the control source as patientID, and in each table patientID is the primary key and linked in relationships).

    If some has some thoughts, they would be much appreciated.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    <snip>
    I am following the same format/properties for the patientID that seem to be in place for the existing pages (its a text box with the control source as patientID, and in each table patientID is the primary key and linked in relationships).
    <snip>
    This sounds wrong. The patientID should be the primary key in the patient table and a foreign key when in other table.

    Maybe you could post a screen shot of the relationship window??

  3. #3
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    Why not use the Link Master/Child properties of the subforms? I'm guessing maybe your Master form is unbound? Another option would be to reference the Main form's id in each subform's recordsource....then write code to requery each subform.

  4. #4
    VictoriaAlbert is offline Novice
    Windows Vista Access 2010 64bit
    Join Date
    Apr 2011
    Posts
    16

    More details

    Thanks for your responses.

    ssanfu - I was incorrect before: PatientID is the primary key in the main ID table but there is no primary key in the other specific health tables, just a field named PatientID. Oddly, though, that doesn't seem to be the issue, b/c some of these health tables that exist in the main form have no relationship to the main ID table, as defined in the relationship window.

    kennejd - re: subforms, I'm not really sure the advantage. they are simply directly inserted into the main form. I can edit it within the main form or the subform, and it automatically gets updated into the main form. Can you give me pointers on how to reference the main form's ID in each subform's recordsource and then how/where to write code for requery-ing each subform.

    I'm stuck on why it works for the other subforms (ie patientID automatically get inserted into the PatientID combo box) but not the new ones that I created. It seems that the PatientID gets updated when a particular macro is run, and this macro has the following Where Condition: =[PatientID]=[Forms]![subformLUI]![LookupName]. So, I don't see why, if I have PatientID in my tables/subforms, these don't get automatically updated, too.

    Again, thanks for your help.

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

Similar Threads

  1. macros in subform dont work
    By tuyo in forum Access
    Replies: 2
    Last Post: 03-25-2011, 09:49 AM
  2. Access database will not work in .Net 2003
    By Brilene in forum Access
    Replies: 0
    Last Post: 03-18-2011, 03:41 PM
  3. Creating a Web Page from a database
    By smallpay in forum Access
    Replies: 1
    Last Post: 02-28-2011, 05:12 PM
  4. Database that runs macros in another DB
    By BED in forum Programming
    Replies: 1
    Last Post: 10-01-2010, 11:20 PM
  5. Converting Access database form onto a web page
    By nosirrah69 in forum Database Design
    Replies: 2
    Last Post: 03-07-2006, 05:06 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