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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update tab control fields from another tab

Status
Not open for further replies.

barbola

Technical User
Feb 27, 2003
1,132
CA
I found this thread to be what I am trying to do also:

But I don't see where to put this code it says to use:
Code:
If tabctl0.VALUE = 5 Then '6th tab

I have an Information tab and I have a Cost tab. The cost tab has a subform where user enters data. I have text fields on the Information tab that shows this data.

User enters data, clicks on Info tab but data is not refreshed. I have a dlookup that works when the Customer is selected, but not when the Cost tab is updated.

How do I do this?
 
I think you are saying you have two subforms each on a tab of a tab control, Cost and Informaton tabs.

It also seems that both subforms might be based on the same recordsource/Table? This is a bad idea if true.

Are you saying that the subform records do not change according to the Main forms record selection? If so, then you probably need to set master and child fields on the subform control.

If none of this is helpful please be more specific about where data is.

 
Thanks but No that's not the issue, and I figured it out.

I have a form with tab controls. TabX has a subform. TabA has unbound text fields that I want to show some data that was entered in the subform.

When TabA is selected, I want it to show the updated data from TabX. I didn't know how to code the form to perform the dlookup when TabA is "selected".

It turns out my code (dlookup) needs to be in the Tab object Change event procedure.
 
Barbola,

You can try this, as I am also using tab pages, and have mine set so that a value from one Tab enters it itnto another.

now my coding skills aren't great so there might be an easier way but try this:

Code:
Dim Name As String
       
If Me!TabCtl0 = 2 Then
        Form_Subfrm_Lap_Entry.Form.Requery
        Subfrm_Lap_Entry!Laptop_ID = Form_Subfrm_Worker_Details_Entry![tblWorkers.ID]
        Name = Form_Subfrm_Worker_Details_Entry![tblWorkers.Forename] & " " & Form_Subfrm_Worker_Details_Entry![tblWorkers.Surname]
        
        Subfrm_Lap_Entry!txtName.SetFocus
        Subfrm_Lap_Entry!txtName.Text = Name
            End If

Basically it brings the Name of the worker based on the ID of the worker in the Workers Table.

All of this information is taken from Tab Page 1, and placed into a Text box on Tab Page 2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top