OnEvent Click and Tab Controls

G

Guest

Good Day All..

I have an issue that I had posted previously but it did not get resolved.
It may partially be my fault for not explaining my need/question correctly.

I have a form. The form contains a subform. & a tab control.
The subform has 3 fields listed for the user: ShipTo, BillTo & Account Name
The tab control has 3 tabs. The first tab is where I am struggling right
now.

I want the user to select ('click') on the "account" in the subform (data
sheet) at the top. Once they click the "account" the fields on the tab
control will then fill with the data for that specific "account". (Contact,
Address 1, Address 2, City, State, Zip, etc.)

I am not sure what I am missing from a VBA code to make it happen. In the
past I have had forms that passed an "ID" but those opened a form instead of
sending the data to the fields of the tab control.

Does this make sense?

Thanks,
Jim
 
M

Marshall Barton

That said:
I have an issue that I had posted previously but it did not get resolved.
It may partially be my fault for not explaining my need/question correctly.

I have a form. The form contains a subform. & a tab control.
The subform has 3 fields listed for the user: ShipTo, BillTo & Account Name
The tab control has 3 tabs. The first tab is where I am struggling right
now.

I want the user to select ('click') on the "account" in the subform (data
sheet) at the top. Once they click the "account" the fields on the tab
control will then fill with the data for that specific "account". (Contact,
Address 1, Address 2, City, State, Zip, etc.)

I am not sure what I am missing from a VBA code to make it happen. In the
past I have had forms that passed an "ID" but those opened a form instead of
sending the data to the fields of the tab control.


I suggest that you use the DoubleClick event instead of
Click, because users might click inadvertantly.

The code would be something along these lines:

Parent.txtContact = Me.Contact
Parent.txtAddress1 = Me.[Address 1]
. . .
 
G

Guest

Marsh..

Thanks for the response. I may be missing the picture here. I assume the
call of "Parent" refers to a parent link in the form. If so then that could
be an issue since I do not have a parent/child link.

I felt the click event was okay to use since it will not do any harm if the
user clicks on the datasheet subform in error. It will only provide the data
to the defined fields which would easily be updated when clicking on another
item.

If you could clarify a bit then it may put me back on the right track. I am
semi-novice in the world of Access VBA. I am waiting on a book I ordered to
help with that part of it. =)

Thanks,
Jim
--
"Baliff. Whack him in the pee-pee!"
"How come his is so much bigger then yours?"
"I am not even suppose to be here today!"


Marshall Barton said:
That said:
I have an issue that I had posted previously but it did not get resolved.
It may partially be my fault for not explaining my need/question correctly.

I have a form. The form contains a subform. & a tab control.
The subform has 3 fields listed for the user: ShipTo, BillTo & Account Name
The tab control has 3 tabs. The first tab is where I am struggling right
now.

I want the user to select ('click') on the "account" in the subform (data
sheet) at the top. Once they click the "account" the fields on the tab
control will then fill with the data for that specific "account". (Contact,
Address 1, Address 2, City, State, Zip, etc.)

I am not sure what I am missing from a VBA code to make it happen. In the
past I have had forms that passed an "ID" but those opened a form instead of
sending the data to the fields of the tab control.


I suggest that you use the DoubleClick event instead of
Click, because users might click inadvertantly.

The code would be something along these lines:

Parent.txtContact = Me.Contact
Parent.txtAddress1 = Me.[Address 1]
. . .
 
M

Marshall Barton

That said:
Thanks for the response. I may be missing the picture here. I assume the
call of "Parent" refers to a parent link in the form. If so then that could
be an issue since I do not have a parent/child link.

I felt the click event was okay to use since it will not do any harm if the
user clicks on the datasheet subform in error. It will only provide the data
to the defined fields which would easily be updated when clicking on another
item.


If you are not familiar with a term, look it up in VBA Help.

Parent refers to the form object that contains the subform
kind of like Me refers to the form that contains the line of
code that uses Me. Maybe you want to think of Parent
refering to the parent form of Me

Use whatever event you like. I was just pointing out a
potential drawback to using a common event to update data,
especially if it might change an existing record.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top