Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Synchronizing several forms with subforms

Status
Not open for further replies.

GoingCrazy

Technical User
May 7, 2001
30
US
I have several forms with subforms that are synchronized using the DWG# and DWGREV fields of each of the tables. Everything works fine until I try to add a record using an existing DWG# and give it a new DWGREV letter. It works on the form that I add the record to, but when I go to the next form, it reverts to the original DWG# and DWGREV. Linking the forms with the wizard only gives me one field I can link the forms with...is it possible to give it 2 fields to link on? Here is the code behind the command button to move to the next form:
Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "frmChklist-Main-LC"

stLinkCriteria = "[DWG#]=" & "'" & Me![DWG#] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Thanks for any help you can provide...

GoingCrazy
 
stLinkCriteria = "[DWG#]=" & "'" & Me![DWG#] & "' AND [DWGREV] = '" & Me![DWGREV] & "'"

Assumming DWGREV is text or drop the single quotes if not.
 
MajP -

Thanks for your help. Your code does clear the next form and allows new info to be added, but is there a way that the new record started on the previous page will populate the next form with the same DWG# and DWGREV information?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top