MarkWaddington
Programmer
Hi, I have a main form on my database, and in turn I click on a command button and it opens another form with the same Autonumber primary key as the first form. Here's the code:
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Client_Status"
stLinkCriteria = "[StatusNo]=" & Me![RegNo]
DoCmd.OpenForm stDocName, , , stLinkCriteria
This works ok on existing records, but if I make a new record and click the open form button, it doesn't automatically make another record on the other form.
In the past, the way I have got round this is by adding one extra line of code underneath the other code, which is:
Forms![Client_Status]![StatusNo] = Forms![Client]![RegNo]
This sets the opened form in sync with the main form, and creates a new record if necessary.
My problem is that all changes to these forms are logged by the date and time and the user that updated the form. When a form is opened the line of code is treated as an UPDATE. Now I don't want this, I only want it to be classed as an update when data is entered into this form.
Any way round this?
Thanks in advance.
Mark Waddington.
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Client_Status"
stLinkCriteria = "[StatusNo]=" & Me![RegNo]
DoCmd.OpenForm stDocName, , , stLinkCriteria
This works ok on existing records, but if I make a new record and click the open form button, it doesn't automatically make another record on the other form.
In the past, the way I have got round this is by adding one extra line of code underneath the other code, which is:
Forms![Client_Status]![StatusNo] = Forms![Client]![RegNo]
This sets the opened form in sync with the main form, and creates a new record if necessary.
My problem is that all changes to these forms are logged by the date and time and the user that updated the form. When a form is opened the line of code is treated as an UPDATE. Now I don't want this, I only want it to be classed as an update when data is entered into this form.
Any way round this?
Thanks in advance.
Mark Waddington.