I have two forms: Form 1 holds basic client info (name address etc). Form 2 holds info specific to each time we meet (sessions info). Each client gets assigned a unique Client ID in Form 1 (my own ref ID and not primary key)
So each client has just one record in Form 1, but multiple records in Form 2.
Question: How can I get Access to automatically carry over the Client ID from Form 1 to Form 2 so it is there when I click 'add new session' button?
So I have the Client information entered into Form 1, click on the button I created to add new session info (go to Form 2), but I would like the Client ID field in Form 2 to be automatically entered in Form 2 as I have just assigned it in Form 1!
Wow, hope some of you can understand that with all the form 1 / form 2 mentions!
Thanks in advance for helping this Access Amateur!
At the moment that looks a bit beyond me, but I will search around in the DB and see if I can use your comments. (I am just a basic user). It looks like the code I see in the VB editing area (a language I know nothing about!
So there's no chance I can achieve this simply by adding a link relationship with an auto update type feature??? (ever hoping for the simple path!).
Thanks for your message and I'm I will be able to use it in time!
Yes, you need to know a little (very little) VBA to use my suggestion.
All you have to do is add the code to the click event that opens form2... something like this:
Private Sub cmdOpenForm2_Click()
DoCmd.OpenForm , "frmForm2", , , , , "ClientNumber"
on the open event of Form2 you could set a text box to the client number with code like this:
Private Sub Form2_Open(Cancel As Integer)
Me.txtClientNumber.Value = Me.OpenArgs
It aint rocket science and I think it will do what you are trying to do.