G
Guest
Need to know how to transfer a field value to another field in a different
form.
Here is want I have: I have two forms, one called Clients and one called
Events. I have a subform under clients called Events Subform which continues
some information in the form called Events. Then I have a command button
that you click on called "Clients Events" which opens the Events Form which
continues more detail infomation on the clients event. I have another
command button that you can click on called "New Events" which opens the
Event Form with a new record waiting for you to input. When you click on
"New Events" command button you have to manual input the Events Account No.
in that field. I want this field to be inputed automatically from the
Clients Form which the fields is called Clients Account No.
Here is the code I have for the Command Button "New Events":
Dim stDocName As String
Dim stLinkCriteria As String
Dim stAccNo As String
stAccNo = Me.ClientAccountNo
stDocName = "Events"
DoCmd.GoToRecord , , acNewRec
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
I can't get the command (Me.EventAccountNo = Me.ClientsAccountNo) To work
because it isn't listed with the list box pops up after me. command.
What else can I try? Please help! Also tried setting my default value of
EventAccountNo to stAccNo. Didn't work!
form.
Here is want I have: I have two forms, one called Clients and one called
Events. I have a subform under clients called Events Subform which continues
some information in the form called Events. Then I have a command button
that you click on called "Clients Events" which opens the Events Form which
continues more detail infomation on the clients event. I have another
command button that you can click on called "New Events" which opens the
Event Form with a new record waiting for you to input. When you click on
"New Events" command button you have to manual input the Events Account No.
in that field. I want this field to be inputed automatically from the
Clients Form which the fields is called Clients Account No.
Here is the code I have for the Command Button "New Events":
Dim stDocName As String
Dim stLinkCriteria As String
Dim stAccNo As String
stAccNo = Me.ClientAccountNo
stDocName = "Events"
DoCmd.GoToRecord , , acNewRec
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.GoToRecord , , acNewRec
I can't get the command (Me.EventAccountNo = Me.ClientsAccountNo) To work
because it isn't listed with the list box pops up after me. command.
What else can I try? Please help! Also tried setting my default value of
EventAccountNo to stAccNo. Didn't work!