By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Record Look Up

P: 20
Hi All,

I have forms A, B, C and D all linked through various ID fields - A linked to B, B linked to C, C linked to D. I also have a command button on each form that closes the current form and opens the next.

How can I set up the forms so that when form B closes and form C opens, form C opens displaying the same ID record I was working with in from B?
Dec 27 '06 #1
Share this Question
Share on Google+
5 Replies


nico5038
Expert 2.5K+
P: 3,072
In a similar case I used the tab control.
The forms can be placed as subforms and the tabs can be controlled like:
me.tabCTL.pages("first").visible = false
me.tabCTL.pages("second").visible = true
etc. with the pagename or relative like:
me.tabCTL.pages(1).visible = false
me.tabCTL.pages(2).visible = true
etc.

Idea ?

Nic;o)
Dec 27 '06 #2

P: 20
In a similar case I used the tab control.
The forms can be placed as subforms and the tabs can be controlled like:
me.tabCTL.pages("first").visible = false
me.tabCTL.pages("second").visible = true
etc. with the pagename or relative like:
me.tabCTL.pages(1).visible = false
me.tabCTL.pages(2).visible = true
etc.

Idea ?

Nic;o)
Forgive me in advance if I complicate this. It's a good idea, but because I didn't disclose more details, it may not work. My apologies.

Forms are set up so that Form A also has Subform A1 attached (linked through an ID field). Subfrom A1 then becomes Main Form B on the next form. Main Form B has Subform B1 attached (linked through ID field). Subform B1 then becomes Main Form C on the next form. And so on.

As I move from "Main Form B/Subform B1" to Main Form C, How can I load Main Form C with the last record I used in Subform B1?

Otherwise, Main Form C load with the first record on file and I have to scroll to find the newest record I added. I hope this makes sense, and again my apologies.
Dec 27 '06 #3

nico5038
Expert 2.5K+
P: 3,072
No problem, the tabbed control approach will also work for this scenario.
All you need is to place (hidden) textcontrols for every needed linking key.
Let's assume subformB has the OrderID to be linked to subformC.
Place a field txtOrderID on the mainform.
Add to subformB's OnCurrent event:
Parent.txtOrderID = Me.OrderID
Finally add txtOrderID as the Master Linkage field for the subformC and OrderID as the Child linkage field.
The subformB and subformC are now automatically synchronized.

Getting the idea ?

Nic;o)
Dec 27 '06 #4

P: 20
No problem, the tabbed control approach will also work for this scenario.
All you need is to place (hidden) textcontrols for every needed linking key.
Let's assume subformB has the OrderID to be linked to subformC.
Place a field txtOrderID on the mainform.
Add to subformB's OnCurrent event:
Parent.txtOrderID = Me.OrderID
Finally add txtOrderID as the Master Linkage field for the subformC and OrderID as the Child linkage field.
The subformB and subformC are now automatically synchronized.


Getting the idea ?

Nic;o)
I think so. But just to be clear, Subform B has the OrderID to link to Main Form C - not sure if this makes a difference. Also, not sure what you mean by "SubformB's OnCurrent event." I can't find the OnCurrent event.

I test this out most of tonight post a reply tomorrow.
Dec 27 '06 #5

NeoPa
Expert Mod 15k+
P: 31,615
I think so. But just to be clear, Subform B has the OrderID to link to Main Form C - not sure if this makes a difference. Also, not sure what you mean by "SubformB's OnCurrent event." I can't find the OnCurrent event.

I test this out most of tonight post a reply tomorrow.
In Design mode open Properties (Alt-Enter) then select the subform (Properties will show a Subform/Subreport item).
Now select the form that is in the subform (Properties should show as a Form now.) and look down the properties list. Under Tag you should see the On Current property. Set this to [Event Procedure] then click on the ... button at the right to create / switch to a new 'OnCurrent' event procedure.
Dec 30 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.