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

Update code not linking form and table, WHY!!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
When entering data in the field [STRIP REPLATE]![GRIT] of form [SEND OUT FOR REPLATE] I get a pop-up form asking for SEND OUT FOR PLATE!Strip Replate!Grit . Upon entering data or selecting ok a second pop-up form asks for SEND OUT FOR PLATE!Strip Replate!FBM ID. If I enter data in these pop-ups the fields our updated in WHLINVTY table. Does anyone know why the update is not recognizing or linking the fields with the form?
This is the Update code I’m using.
DoCmd.RunSQL ("UPDATE WHLINVTY SET [WHLINVTY].[GRIT] = [SEND OUT FOR REPLATE]![Strip Replate]![GRIT] WHERE [SEND OUT FOR REPLATE]![Strip Replate]![FBM ID]=[WHLINVTY].[FBM ID]")
 
Hi Larry,
try changing your code from
Code:
DoCmd.RunSQL ("UPDATE WHLINVTY SET [WHLINVTY].[GRIT] = [SEND OUT FOR REPLATE]![Strip Replate]![GRIT] WHERE [SEND OUT FOR REPLATE]![Strip Replate]![FBM ID]=[WHLINVTY].[FBM ID]")
to
Code:
DoCmd.RunSQL ("UPDATE WHLINVTY SET [WHLINVTY].[GRIT] = [forms]![SEND OUT FOR REPLATE]![Strip Replate]![GRIT] WHERE [forms]![SEND OUT FOR REPLATE]![Strip Replate]![FBM ID]=[WHLINVTY].[FBM ID]")
Richard
 
Tried that N.G.

OK, I found If I set the form SEND OUT FOR REPLATE OrderBy property to a Date field in the "Strip Replate" table it works fine. Question then is how do I make sure that orderby property is set at after update.
 
That's strange! It still asks you to enter the parameters manually? oh well.

If you want to change the orderby property on the form in code use the following:
Code:
[forms]![SEND OUT FOR REPLATE].orderby = "fieldname"[code]
obviously replace fieldname with the name of the field you want to sort by.
Richard
 
Hi,
replace both instances of [ with [ in my previous email
Richard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top