Hello
I am using Access 2010. I have a table of data for patient transfers. I have a different form depending on the transfer type and not all cases will require a nurse for the transport but all will require cost information.
The db was created by someone else and I don't want to change too much but I would like to build a button on the main form that would open up another form that would allow me to enter the nurse information on one new form and the cost information on another.
I can't seem to get this to work where when the subreport opens it is for the same record as the main report. The code currently that isn't working:
Note that the user can either enter a new record or be editing an existing. I mention that because I originally had code so that it saved the record first because I thought the issue might be that the record wasn't saved yet to show up in the subform but if I exit out of the main form and check the table, the record was saved. If I put the docmd to save the record, it gives me an error if it's not a new record.
Thanks.
I am using Access 2010. I have a table of data for patient transfers. I have a different form depending on the transfer type and not all cases will require a nurse for the transport but all will require cost information.
The db was created by someone else and I don't want to change too much but I would like to build a button on the main form that would open up another form that would allow me to enter the nurse information on one new form and the cost information on another.
I can't seem to get this to work where when the subreport opens it is for the same record as the main report. The code currently that isn't working:
Code:
Private Sub cmdCaseCost_Click()
DoCmd.RefreshRecord
DoCmd.OpenForm "subfrmCaseCost", acNormal, , ID_Number = Me.[txtID], , acDialog
End Sub
Note that the user can either enter a new record or be editing an existing. I mention that because I originally had code so that it saved the record first because I thought the issue might be that the record wasn't saved yet to show up in the subform but if I exit out of the main form and check the table, the record was saved. If I put the docmd to save the record, it gives me an error if it's not a new record.
Thanks.