Requery subform

Lou P

Registered User.
Local time
Today, 12:37
Joined
Jul 9, 2010
Messages
36
I have a subForm (subHWEvent) in a tabControl (tabHWInfo) (tabEvents) that I am trying to link to another subform (subHWEventRmks).
What happens is...I can create a new "Event" record in the 1st subform (subHWEvent), but when I open the 2nd subform (subHWEventRmks) using a buttonControl to enter "Remaks" into the 2nd subform (subHWEventRmks) it opens the (subHWEventRmks) but creates a new Event record rather than linking it to the current new Event record.

I tried to initiate a Requery from the subHWEvents form using a combobox (EventType) AfterUpdate. No joy.

Main form - frmHW from tblHW linked to the subHWEvent using HWID & EVENTID
1st subForm - subHWEvent from tblEvents
Tab Control - tabEventInfo
Tab - tabEvents
2nd subForm - subHWEventRmks from tblEvents

Please advise...TYVM
 
Welcome to AWF!

Is the Record Source of subHWEvent based on a query?
 
vbaInet;

Thank you for the welcome & the help.
No the record source for the subHWEvent is tblEvents.

I'm getting that "dummy" feeling...

Lou
 
:)
1. Create a new query and include all the fields from tblEvents into it
2. Set the Record Source of subHWEvents to this new query in step 1

What is the name of the field that should link subHWEvents and subHWEventRemarks? And what datatype is it?
 
The name of the field that is suppose to link the two subforms is EVENTID

The only fields on the subHWEventRmks is EVENTID & EventRemarks.

In the tblEvents EVENTID is a Number, but I've concatenated it with some other fields from the tblEvents.
 
In the tblEvents EVENTID is a Number, but I've concatenated it with some other fields from the tblEvents.
Separate the ID from those other fields and if still retain your concatenated fields.

In this new query you've just designed and under the Criteria row for EventID, put something like this that refers to the event id textbox located on subHWEventRemarks:
Code:
[Forms]![[COLOR=Red][B]Main Form Name[/B][/COLOR]]![[COLOR=Blue][B]subHWEvent[/B][/COLOR]]![[B][COLOR=Blue]EventID[/COLOR][/B]]
Substitute the name of the form with the bit in red. Check that the bits in blue are correct.

Since it's only just two fields then I suppose all you want in that query is just those two fields.

For the final bit you need to requery subHWEventRemarks so it's synchronised so you would put this in the ON CURRENT event of subHWEvent:
Code:
Me.Parent.subHWEventRemarks.Requery
 
vbaInet;

Thanks for the help. Was able to get it woking.
 

Users who are viewing this thread

Back
Top Bottom