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

Me.Requerry not entering data into table w/o closing form

Status
Not open for further replies.

TomDuCrosbie

Technical User
Aug 28, 2003
27
US
I have a form for entering and viewing customer info. Once the customer's name is entered, there is and after update event to create the ClientID. There is an After Update event for ClientID Me.Requerry . I had the understanding that this would make the data show in the table, so when other info in sub forms is entered, everything works.

however, the data doesn't show up in the table until the form is closed. I can't have users enter the customers name, close the form, then re-open the form inorder to enter more information.

If the form isn't closed the error "The data has been saved to the database, but can not be displayed be cause of conditions of the underlying record source."

The error is because the subforms are all linked with the ClientID which isn't inputed into the table untill the form is closed.

Any sugestions?

Tom
 
Tom,

I think you misunderstand what Me.Requery does; it reloads the recordset for the current form. If you change it to
DoCmd.RunCommand acCmdSaveRecord

this will save the record (note: this will only work if Client ID is the only mandatory field in the table; if there are others, saving then will fail because of other non null values).

John
 
John

I tried the DoCmd.RunCommand acCmdSaveRecord and I get the same error. I forgot to mention in the origonal post I'm using Access Project and Microsoft SQL Server 2000.

Does that make a difference?

Tom
 
Assuming that all the client ID AfterUpdate event does is save or requery the record, then you actually don't need it at all; when you change the focus from the main form to one of the subforms the main record will save to create the master part of your master:detail table relationship.

I haven't used the Access Project/MSDE or SQL Server in depth at all; if it still doesn't work after my suggestion and if nobody else can think of anything I would consider asking in the appropriate SQL Server or MSDE/Access Data Project forums.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top