PC Review


Reply
Thread Tools Rate Thread

Drop Down Won't Requery

 
 
Lynn
Guest
Posts: n/a
 
      10th Nov 2003
The following code allows a user to type in a record in
the dropdown box and if the record does not exists it
prompts the user to add the record via another form. The
problem is the drop down will not requery. It works in
DAO but not ADO.

The record does get added to the table but the user has to
close the form and then reopen it to see the new record in
the drop down box.

Any suggestions?

Private Sub cboVendor_NotInList(NewData As String,
Response As Integer)

Dim strMsg As String


strMsg = "Vendor not on list. Would you like to add
it?"

If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, "New
Vendor") Then
pintResponse = acDataErrContinue
MsgBox "You must select from the dropdown list or
add the Vendor.", vbOKCancel
Else
DoCmd.OpenForm "frmAddEditVendor", , , , , acDialog
pintResponse = acDataErrAdded

End If

End Sub
 
Reply With Quote
 
 
 
 
Ken Snell
Guest
Posts: n/a
 
      11th Nov 2003
Change
pintResponse
to
Response

You're not using the correct variable name.
--
Ken Snell
<MS ACCESS MVP>

"Lynn" <(E-Mail Removed)> wrote in message
news:027601c3a7ca$f4629680$(E-Mail Removed)...
> The following code allows a user to type in a record in
> the dropdown box and if the record does not exists it
> prompts the user to add the record via another form. The
> problem is the drop down will not requery. It works in
> DAO but not ADO.
>
> The record does get added to the table but the user has to
> close the form and then reopen it to see the new record in
> the drop down box.
>
> Any suggestions?
>
> Private Sub cboVendor_NotInList(NewData As String,
> Response As Integer)
>
> Dim strMsg As String
>
>
> strMsg = "Vendor not on list. Would you like to add
> it?"
>
> If vbNo = MsgBox(strMsg, vbYesNo + vbQuestion, "New
> Vendor") Then
> pintResponse = acDataErrContinue
> MsgBox "You must select from the dropdown list or
> add the Vendor.", vbOKCancel
> Else
> DoCmd.OpenForm "frmAddEditVendor", , , , , acDialog
> pintResponse = acDataErrAdded
>
> End If
>
> End Sub



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drag & Drop Email Message to Appt Doesn't Drop Attachment veejaycee Microsoft Outlook Calendar 2 9th Oct 2008 02:49 PM
Requery issue : Application closes on form.requery.... =?Utf-8?B?c3VyeWE=?= Microsoft Access Form Coding 3 6th Nov 2006 09:58 PM
Requery the 1st requery result which displayed in form vincentt via AccessMonster.com Microsoft Access 2 31st Aug 2006 04:49 AM
Values drop during requery =?Utf-8?B?cmljbw==?= Microsoft Access 1 24th Jan 2006 04:43 PM
requery for drop-downlist in sub-form Bob Richardson Microsoft Access 0 5th Nov 2004 08:49 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:27 AM.