abbaddon223
Registered User.
- Local time
- Today, 07:27
- Joined
- Mar 13, 2010
- Messages
- 162
Hi - I'm hoping someone can help me please? :banghead:
I have a combobox which is bound to a table from which it get's its text values.
When a user changes the value of the combobox, they are promoted with a vbYesNo - do you want to make a change.
If Yes - stuff happens / If No - it doesn't. All is well at this stage
The issue is, if the current value of the combobox is set to
"No Sent" and the use selects "Sent" from the combobox, even if they select No to the VbYesNo prompt, the value of the combo box changes to "Sent" (the reset of the code which executes if Yes doesn't run, but I'm left with a declined value in the combobox"). Code below:
Dim Outcome As String
Outcome = [Current_State].Value
Dim Answer As Integer
Answer = MsgBox("Commit This Data To History?", vbCritical + vbYesNo, "Continue Request?")
If Answer = vbYes Then
DoCmd.SetWarnings False
[Status_URN].Value = [Customer_URN] & [Current_State] & Date
[Current_Status_Date].Value = Date
[Forms]![Frm_1_Q&A_Customer_Details]![Stage].Value = DLookup("Stage", "Lookup_Status", "Status='" & Current_State & "'")
Dim Ref As String
Ref = [Customer_URN]
DoCmd.Close acForm, "Frm_1_Q&A_Customer_Details"
DoCmd.OpenQuery "App_Unmatched_History"
DoCmd.OpenForm "Frm_1_Q&A_Customer_Details"
[Forms]![Frm_1_Q&A_Customer_Details]![Customer_URN].SetFocus
DoCmd.FindRecord Ref
DoCmd.OpenForm "Frm_CRM_History"
MsgBox "Add Notes To New Pipeline Status", vbExclamation, "Action Required"
End If
If [Forms]![Frm_1_Q&A_Customer_Details]![Current_State].Value = "Pack Resent" Then
[Forms]![Frm_1_Q&A_Customer_Details]![Days_From_Created].Value = 0
Exit Sub
End If
If Answer = vbNo Then
MsgBox "Action Cancelled", vbInformation, "Update Recieved"
[Current_State].Value = Outcome
Exit Sub
End If
My variable is after update - can I do a before update then referenece?
I have a combobox which is bound to a table from which it get's its text values.
When a user changes the value of the combobox, they are promoted with a vbYesNo - do you want to make a change.
If Yes - stuff happens / If No - it doesn't. All is well at this stage
The issue is, if the current value of the combobox is set to
"No Sent" and the use selects "Sent" from the combobox, even if they select No to the VbYesNo prompt, the value of the combo box changes to "Sent" (the reset of the code which executes if Yes doesn't run, but I'm left with a declined value in the combobox"). Code below:
Dim Outcome As String
Outcome = [Current_State].Value
Dim Answer As Integer
Answer = MsgBox("Commit This Data To History?", vbCritical + vbYesNo, "Continue Request?")
If Answer = vbYes Then
DoCmd.SetWarnings False
[Status_URN].Value = [Customer_URN] & [Current_State] & Date
[Current_Status_Date].Value = Date
[Forms]![Frm_1_Q&A_Customer_Details]![Stage].Value = DLookup("Stage", "Lookup_Status", "Status='" & Current_State & "'")
Dim Ref As String
Ref = [Customer_URN]
DoCmd.Close acForm, "Frm_1_Q&A_Customer_Details"
DoCmd.OpenQuery "App_Unmatched_History"
DoCmd.OpenForm "Frm_1_Q&A_Customer_Details"
[Forms]![Frm_1_Q&A_Customer_Details]![Customer_URN].SetFocus
DoCmd.FindRecord Ref
DoCmd.OpenForm "Frm_CRM_History"
MsgBox "Add Notes To New Pipeline Status", vbExclamation, "Action Required"
End If
If [Forms]![Frm_1_Q&A_Customer_Details]![Current_State].Value = "Pack Resent" Then
[Forms]![Frm_1_Q&A_Customer_Details]![Days_From_Created].Value = 0
Exit Sub
End If
If Answer = vbNo Then
MsgBox "Action Cancelled", vbInformation, "Update Recieved"
[Current_State].Value = Outcome
Exit Sub
End If
My variable is after update - can I do a before update then referenece?
Last edited: