Paul Cooke
Registered User.
- Local time
- Today, 08:51
- Joined
- Oct 12, 2001
- Messages
- 288
I have tried all day to sort this out myself and learn something but my lack of knowledge and understanding has finally won over hence this post !! So...
(please note 'Form1' is a test form the actual message in the code below is from the control I want to use the code on - when it works!)
I have a form 'Form1' on this form is a combo called Combo1.
If I enter text in the combo box that is not in the list, a MsgBox pops up the message informs the user the data cannot be entered ect ect..
1.They click ok
2.Another message pops up asking if they want to exit the form or enter another record
3. If they select 'No' then Form1 should close without saving anything and 'MainForm' should open
4. If they select 'Yes' the msgbox goes Form1 is on the screen at a new record.
I have tried tons of different ways to do this but really have lost the will to live. Please will someone help me with this code
There was other bits of code at the bottom such as GotoRecord ect ect but i have changed it so many times I can't actually remember what I've done.
I will be really really REALLY grateful for some help,
Many thanks
Paul
(please note 'Form1' is a test form the actual message in the code below is from the control I want to use the code on - when it works!)
I have a form 'Form1' on this form is a combo called Combo1.
If I enter text in the combo box that is not in the list, a MsgBox pops up the message informs the user the data cannot be entered ect ect..
1.They click ok
2.Another message pops up asking if they want to exit the form or enter another record
3. If they select 'No' then Form1 should close without saving anything and 'MainForm' should open
4. If they select 'Yes' the msgbox goes Form1 is on the screen at a new record.
I have tried tons of different ways to do this but really have lost the will to live. Please will someone help me with this code
Code:
Private Sub cboProductionEmployerDetailsID_NotInList(NewData As String, Response As Integer)
Dim intResponse As Integer
Dim strMsgTxt As String
intResponse = MsgBox("There is no record of the Production / Employer name:-" & vbCrLf & vbCrLf & Chr(34) & NewData & Chr(34) & vbCrLf & vbCrLf & _
"If the patient is with you now, please complete a paper treatment form." & vbCrLf & vbCrLf & _
"If you are entering the details from a paper treatment form, please put form to one side and await further instructions." & _
vbCrLf & vbCrLf & "An email has been sent to Paul to check the Production or Employer details.", vbInformation + vbOKOnly, "Production or Employer Name")
Response = acDataContinue
If MsgBox("Do You wish to enter another treatment record", vbQuestion + vbYesNo, "Option") = vbNo Then
DoCmd.Close
End If
There was other bits of code at the bottom such as GotoRecord ect ect but i have changed it so many times I can't actually remember what I've done.
I will be really really REALLY grateful for some help,
Many thanks
Paul