Hi,


This is kind of a VB/Access question.
I Use the following code for a Not in list function in Access.

Private Sub Combo275_NotInList(NewData As String, Response As Integer)
Dim strSQL As String
Dim i As Integer
Dim Msg As String

'Exit this sub if the combo box is cleared
If NewData = "" Then Exit Sub

Msg = "'" & NewData & "' is not currently in the Database." & vbCr & 
vbCr
Msg = Msg & "Press OK to continue"

i = MsgBox(Msg, vbOKOnly, "Unknown Client...")
If vbOK Then
Me.Combo238 = NewData
Me.Combo275.Undo
Me.Combo275.Requery
Me.Combo275.Dropdown

Combo238.SetFocus

Me.Combo275.Visible = False
End If

Response = acDataErrContinue
       
End Sub

---> I keep getting Cant move focus to combo238 error. Here is what I 
would like it to do:
User starts typing in name, if name is in list, It does an OnExit 
moving data form the combobox275 to fields below on form, then making 
combobox275 not visible. If its not on the list, take the name they 
typed in combobox275 and move it to combo238(LastName field) then 
make combo275 not visible. I've tried different ways, and either I 
get the can't move focus or it moves the data, but still gives the 
msgbox "Item not on list"

Any ideas or samples would be great!!!

Thanks in Advance

Joe

 






------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To reply to this message, go to:
    
http://groups.yahoo.com/group/visualbasic6programming/post?act=reply&messageNum=17934
    Please do not reply to this message via email. More information here:
    http://help.yahoo.com/help/us/groups/messages/messages-23.html

<*> To visit your group on the web, go to:  
    http://groups.yahoo.com/group/visualbasic6programming/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to