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

NotOnList Event Procedure Works Partially

Status
Not open for further replies.

AccUser

MIS
May 11, 2000
96
US
Situation:<br><br>User types in data in dropdown list. The data is not on list. I have event procedure that will open a form to add the item to the table and a button to close the form when done.<br><br>Problem:<br><br>The new item does not appear on the dropdown list. The item will only appear if you close the form and reopen it.<br><br>Any takers?
 
Did you add this code to the NotInList event procedure?<br><br>Response = acDataErrAdded<br><br>This tells Access that new data has been added and it should requery the db. <p>Jim Conrad<br><a href=mailto:JimConrad@Consultant.com>JimConrad@Consultant.com</a><br><a href= > </a><br>
 
No. What I have is a ReQuery command when the form gets the focus, but that doesn't seem to work.<br><br>Also, I tried the sample code of the NotOnList and get an error message when it runs <br><br>&quot;characters found after end of SQL statement&quot;
 
AccUser: <br><br>At the &quot;On Activate&quot; event at Form properties, put a Requery Macro. At this requery macro, put the name of the fields (dropdown list)that need to be requery. <br><br>rgrds, <br>Patricio Matute. <br>
 
Also tried the requery macro. I get an action failed open after I click on the button to close the form.<br>
 
additional info.<br><br>If I take out the Requery Macro, the Add New Item Form and close properly. The new item is not reflected in the dropdown list, but has been added to the table.<br><br>Now, if I clear the dropdown field, then select records and refresh, the new item now appears (same as exiting and opening the form)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top