i need help please

spider2vb

New member
Local time
Today, 16:17
Joined
Sep 22, 2011
Messages
2
Hiii all

I have form [Order] and a subform [OrderDetail] which displays multiple records from a query. I use a combo box to choose which record to display in the subform. I need when change current selected record from combo box display message "Are you sure to change current record" and if false cancel action , if true change current record to new record and re-current quantities to the store

Thanks
 
Something like this?

Code:
Private Sub NameCmbBox_BeforeUpdate(Cancel As Integer)
    MsgBox "Are you sure to change current record?", vbYesNo
End Sub
 
If you used the Combo box query wizard to perform the synch action, then it would have produced some code. You need to amend the code to suit your current needs.

So, in the After Update event, before the code fires, you can do something like:
Code:
if Msgbox("Are you sure you want to change the record?", vbYesNo, "Change record confirmation") = vbNo Then
    Exit Sub
End if

... Your original code here ...
 

Users who are viewing this thread

Back
Top Bottom