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

Goto new record

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have a query thats built from a group by query and two tables. I then created a form based off that query. my problem is that when the form opens a cannot goto a new record. when i run the query just by itself i see that theres not a new record in the query. Is there a way to force the query to have a new record in it.?

Thanks
 
A group by query is not updatable so therefore you cannot add new records to it.
 
is there anyway at all to atleast make the records appear blank? I was getting errors when i tryed to make them Null or ""....any ideas?

Thanks
 
Why do you want them to just appear blank if you don't want to actually add a new record to it?
 
I have a combo box that lists the documents that are at a certain status. Therefore when the form opens i want it to appear blank. Then the data entry person can pick and choose the records from the combo box.
 
What you could do is in your query or sql statement that your form is based on, put the combobox of the form in your criteria for the "document" field and that way only once there is something selected in the combo box would the form return records. In the AfterUpdate event of the combo box put the following code:
Me.Requery
Do you follow?
 
yes i follow...but what would be the criteria
=[combo38] i have tryed a couple of other things but does not seem to work.

Thanks for your help
 
I might be missing something here...In my query i put the criteria in the doc field.. But it brings back no records and form opens blank with no data...were exactly should i be putting the criteria?

Thanks
 
You had said that you want the form to be blank when opened. So now when you select the document from the combo box, the form should get filled in (this is assuming that you put the code: me.requery in the AfterUpdate event of the combobox.)
 
Well thats what i want. but the query will not run correctly with that statement in the criteria...the form opens up completly blank with no fields or combo box showing...
may be i can send you an example of this...

Thanks
 
Is the combobox bound or unbound. It should be unbound (no value in the controlsource property). Or maybe another option (which actually has worked for me) is to have the combobox on one form (in the header) with no table bound to it and then create a subform (there's an icon for it on the toolbar) in the detail section based on your table for the rest of the fields that you would want to see only once there is a value in the combobox. In the AfterUpdate property of the combo box you would put:
Me.[Agencies Subform].Form.requery
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top