Forcing Subforms to populate Child filed

Blazer Saga

Registered User.
Local time
Today, 07:29
Joined
Jan 22, 2007
Messages
12
Most if this is a discription for anyone trying to help that needs more then the actual question. Skip to the last paragraph for the actual problem.

I have a form, Frm Art Sheet, with a sub form in it, Frm Numbers Catagory, They are linked using a unique key from the table for the main form, Order ID.

I have a combo box, Cmb Font Styles, in the sub form that has a query using a check box filed from the main form, Chk Dazzle Twill.

Frm Numbers Catagory also has the control field for Chk Dazzle Twill from Frm Art Sheet included in its record sorce query.

The Table that the Cmbo box pulls its values from has an Auton Number ID, Font Style ID, text field for a name, Font Name, and a field storing weather or not it is considered when Chk Dazzle Twill is true, Dazzle Twill YN.

I curently have the OnCurrent() for Frm Numbers Catagory set up to Dims As Strings for the two SQL queries, one for when Dazzle Twill YN is true and one for when its fasle. Then it checks Dazzle Twill YN contol field's value for true or false and sets it apropriatly.

That all works fine and I've tested it withought problem for execution. The problem I'm having is getting it to alway excute when it should.

If I set Dazzle_Twill_YN_AfterUpdate() to do Me.Frm_Numbers_Catagory.requry, Cmb Font Styles will always have the wrong query (Near as I can tell it requerying before it changes the value as I can fore a refresh and get the right query.

If I set Frm_Art_Sheet_AfterUpdate() the same way it will Display the right data in Cmb Font Styles after you change Dazzle_Twill_YN. I though this had fixed my problem, but I jsut ran into one last problem.

If the Frm_Art_Sheet is a new record and they check Dazzle_Twill_YN it will not set the query in for Cmb Font Styles corectly until you have entered data into Frm Numbers Catagory. I think this is because Order ID field for Frm Numbers Catagory hasn't been intialized yet for the liking to work right.

So my question is this. Is there a way to force it to creat a blank record with the number in it, keeping in mind that there are required fields that can't simply be Null and I dont want to set default values (I want the fields blank so they know what they need to fill out). Or is there some way to have the query in a sub form compair with that value of a field in the curent active record of the parent form?
 
Last edited:
Figured it out myself.

Form.Parent will call the parent form if my understanding of the help documentation is correct.

So Form.Parent![Field Name] will call a field in the parent form, even when there is no data in the linking field for it to use. This should always call the curent active record of the partent field.

I an a novice when it comes to Access code though, so don't quote me on this. I have yet to find a case in my database where this is not functioning properly for me though.

If anyone can confirm my understanding, or corect me on it, I would greatly apreciate it, so I can stop worring about running into some problem 3 or 4 months down the line.
 

Users who are viewing this thread

Back
Top Bottom