Data not showing when opening form or selecting new record

skilche1

Registered User.
Local time
Today, 09:15
Joined
Apr 29, 2003
Messages
226
I am using the requery function to filter two combo boxes in two different subforms from the main form when selecting material and color depending on department. I am having no issues with performing that task. The problem I am having is if I shut it down or goto Next record, those fields are empty unless I reselect the Department from the main form, then the other two forms seem to refresh accordingly. If there a way to prevents this so when I do open the form or move to another record, the correct information will appear?

Hope I was clear enough… :rolleyes:

Thanks.
 
I'm not a hundred percent sure but I suspect you need to requery your combos, in the OnCurrent event of the main form.
 
I'm not a hundred percent sure but I suspect you need to requery your combos, in the OnCurrent event of the main form.

John,

Thanks for the reply. How would I requery my combo boxes. I think I'd want to use the =RequeryControl() command, but there is no OnCurrent box in Properties for either combo box (note .jpg attachment). Could there be another way?

Thanks. :confused:
 

Attachments

  • noOnCurent.jpg
    noOnCurent.jpg
    96.6 KB · Views: 170
I'm not a hundred percent sure but I suspect you need to requery your combos, in the OnCurrent event of the main form.

You'll need something like;
Code:
Me!Subform1.Form!Subform2.Form!ControlName.Requery
This link will help you with referencing controls on sub forms
 
You'll need something like;
Code:
Me!Subform1.Form!Subform2.Form!ControlName.Requery
This link will help you with referencing controls on sub forms

OK, I've tried various ways to implement your suggestion and still nothing happens. I have attached a shorter version of my db and was wondering if you could take a peek at it.

This is one aspect that really needs to be cleared up.

Thanks again! :D
 

Attachments

not sure which form you are having trouble with but I had a form & a title i wanted that title to refresh everytime user clicked on next/previous record so i simply created a procedure:

sub assignCaption()
title.caption = firstName & lastName
end sub

and then called it from pageLoad and onCurrent event.

I have a form and a subform, subform can have multiple records. I wanted to create a button called "add record in subform" but ON MAIN FORM so I did:

DoCmd.GoToControl "subformName"
DoCmd.GoToRecord , , acNewRec

I just gave u two scenarios hoping one of them may help! lol
 
OK, I've tried various ways to implement your suggestion and still nothing happens. I have attached a shorter version of my db and was wondering if you could take a peek at it.

This is one aspect that really needs to be cleared up.

Thanks again! :D

OK. I've had a look at your DB and I'm unsure exactly what the problem is. Could you run through, step by step, what you would like to happen, and where things are falling over.
 
OK. I've had a look at your DB and I'm unsure exactly what the problem is. Could you run through, step by step, what you would like to happen, and where things are falling over.

Sure John,

When I use the two nav buttons to nav through the WO's (not the dates) I had put on the form, I can see within the "Fabric Re-Cut Data" area, the two fields (Materials Series and Fabric Color) do not refresh.

:rolleyes:
 
OK I've added two combos as I find it easier to deal with a query than with the raw SQL behind a combo. You may wish to add a third combo, but I'll leave that to you just follow what I've done.

I have also added some code behind the OnCurrent events of your forms frmDataEntry and sfrmDataEntry1. For completeness you should probably put similar code behind the OnChange events Combos cbo1 and CboMS.

Once again I'll refer you to this site for the correct syntax for referencing sub forms and their controls; In fact If I where you I'd book mark it for future reference.
 

Attachments

John,

Great job and thanks. I had to remove the code from OnCurrent on the frmDatAEntry form because it was interfering with a "GoTo" new "Record" macro On Open I added to it and it seems to be working fine without it. You wouldn't foresee any issue with that in the future, do you?

The good thing, with every new database I start, I learn more and more by dicecting the help I get from others.

BTW, I did take note of the that site for references. Just deciding how to implement them is another issue.

Thanks again and have a great evening.
 

Users who are viewing this thread

Back
Top Bottom