Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab Requery Problem

Status
Not open for further replies.

Ludington

Programmer
Oct 1, 2007
16
US
My main form consists of 3 tabs as follows:
1. Client Tab
2. Veteran Tab
3. Payment Tab

I can have more than one veteran # per client, thus more than one payment.

When I select the Payment Tab, I want to select the same veteran # that the Veteran Tab was on.

Example: If the Veteran Tab was on Veteran # 5, I want Veteran # 5 select on the Payment Tab.

When I try to requery selecting the veteran # from the veteran tab I receive the following error:

Run time error 2109: There is no field name 'Client Vendor Query' in the current record.

I got it to work using a macro and opening up the veteran payment form where the veteran # equal the veteran # in the Veteran Data tab but this causes the form to open up outside the main form with my 3 tab selections. I need to stay within my main form 3 tab selections.

Any ideas would be greatly appreciated.

Thanks...Ludington



 
Basically, you are trying to sync two continuous subforms within one form. Here are how you do it:

1. create an unbound textbox in the main form called txtVeteranID;

2. Within the subform inside Veteran tab, put the following code under Form_current event

Me.Parent.Form!txtVeteranID = Me!VeteranID

3. In the Payment tab, in the properties sheet of the Payment subform, set the following values to define the relationship between this subform and the main form.

Link Child Fields: VeteranID
Link Master Fields: txtVeteranID

That's all.

Hope this helps.

Seaport




 
Thanks Seaport that work pretty good except it locks me in to that VeteranID; which I might have to accept.

Once I get to the Payment form I wanted the ability to go through all Veteran Payments for that Client (if need be).

Your way I have to go back to the VeteranID tab and select a different veteranID then go to the Payment tab again.

Thanks again...Ludington
 
You can make the txtVeteranID into a combox - dropdown list contains all veteran ID for that client.

So you can select any Veteran ID and the right payments will appear in the Payment tab.

Seaport
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top