Hi everyone.
I'm a newby in VBA and I have been trying to do something for sometime without any success.
I have 5 command buttons on my “main” form. All on them open the same “page” form only the subforms change depending on the command button clicked.
On the “page” form the users manually enter a code depending on the command button clicked (e.g cmd 1 = “ABC”, cmd 2 = “DEF”…). I would like to eliminate this manual step with an auto filling system. If the users click cmd1, “ABC” should appear automatically in the textbox situated in “page form”.
I'm trying to use the function Me.textbox1.value = "ABC" from a command button. It works fine in On Load option of the “page form”, but it is not what I want.
That’s what I’m trying to do, but it is not working, I guess that Access is looking at Textbox1 in the “main” form not “page “ form
DoCmd.OpenForm "page"
DoCmd.GoToRecord , "page", acNewRec
Me.Textbox1.value = "ABC" (inside "page" form)
Hope this is clear enough and that you can help me.
Thanks
Froggy.
I'm a newby in VBA and I have been trying to do something for sometime without any success.
I have 5 command buttons on my “main” form. All on them open the same “page” form only the subforms change depending on the command button clicked.
On the “page” form the users manually enter a code depending on the command button clicked (e.g cmd 1 = “ABC”, cmd 2 = “DEF”…). I would like to eliminate this manual step with an auto filling system. If the users click cmd1, “ABC” should appear automatically in the textbox situated in “page form”.
I'm trying to use the function Me.textbox1.value = "ABC" from a command button. It works fine in On Load option of the “page form”, but it is not what I want.
That’s what I’m trying to do, but it is not working, I guess that Access is looking at Textbox1 in the “main” form not “page “ form
DoCmd.OpenForm "page"
DoCmd.GoToRecord , "page", acNewRec
Me.Textbox1.value = "ABC" (inside "page" form)
Hope this is clear enough and that you can help me.
Thanks
Froggy.