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

Hell again, this code is attach

Status
Not open for further replies.

Ryon

Technical User
Nov 1, 2002
64
US
Hell again,
this code is attached to a combo box on my form. the code works fine but (there is always a but) it requerys my entire form which changes the recordset. Any ideas on how to make it either just requery the combo box, not requery the combo box till the entire record is saved or bring focus back to the current record.

thanks

Private Sub PMS_NotInList(NewData As String, Response As Integer)
Dim db As Database, rs As Recordset
Dim strMsg As String
strMsg = "'" & NewData & "' is not an available Practice management"
strMsg = strMsg & "@Do you wish to add it to the list?"
strMsg = strMsg & "@Click Yes to Enter new data or No to re-type it."
If MsgBox(strMsg, vbQuestion + vbYesNo, "Add new category?") = vbNo Then
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("tblpms", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!PMS = NewData
rs.Update

If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
End Sub
 
PMS.requery

After you have updated the table (I assume its a look up table).

Vince
 
the code above already requerys the whole form and the PMS combo box (Practice Management System if you were wondering) I dont see how. I was wondering if someone could help me modify this code so it ONLY requerys the combo.

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top