JamesCurtis
Programmer
Hey guys, I'm running into some major problems here. I'm running a run-time environment for a computer service database. My people like to use Cash Customer (one account for multiple people, bad idea i know) to enter the costumers' computer problems into the service DB. on my form I have a print button, which checks to see if it's a new service (via a textbox) then if it's new it'll e-mail me and another person.
I want to add another step into the equation. I'm going to try to force them to put the user information into the Notes field if they decide to use cash customer, and not try to enter first/last name into the cash customer's record, because it gets changed after each time a new cash customer is entered, which results in confusion when we look back in the records and we don't have the names of the customers anymore. What I'm trying to do is have it detect if the customer ID is cash customer, then if it is, open the notes form if the notes field is blank and tell them that they need to enter the user information there. If the notes section isn't blank, it'll close the form and continue to print the service ticket out that we attach to computers. Here's the code
"
Dim stDocName As String
Dim stDocName2 As String
Dim stDocName3 As String
Dim stLinkCriteria As String
stDocName = "Print"
stDocName2 = "Service Record"
stDocName3 = "Notes"
If [newcheck] = True And [CustomerID] = "CASH COUNTER CUSTOMER" Then
DoEvents
stLinkCriteria = "[Service Number]=" & Me![Service Number]
DoCmd.OpenForm stDocName3, , , stLinkCriteria
If [Notes] = Null Then
MsgBox "Please enter the name of the cash customer in the notes, thank you
"
Else
DoCmd.Close acForm, "Notes", acSaveYes
End If
End If
If [newcheck] = True Then
DoEvents
stLinkCriteria = "[Service Number]=" & Me![Service Number]
DoCmd.OpenForm stDocName2, , , stLinkCriteria
DoCmd.RunMacro stDocName
DoCmd.RunCommand acCmdPrint
ElseIf [newcheck] = False Then
MsgBox "This is not a new customer, will not e-mail"
stLinkCriteria = "[Service Number]=" & Me![Service Number]
DoCmd.OpenForm stDocName2, , , stLinkCriteria
End If
"
Pardon me for my crappy programming skills, i've only had one semester of VB two years ago and i Haven't messed with it since
Thanks!
I want to add another step into the equation. I'm going to try to force them to put the user information into the Notes field if they decide to use cash customer, and not try to enter first/last name into the cash customer's record, because it gets changed after each time a new cash customer is entered, which results in confusion when we look back in the records and we don't have the names of the customers anymore. What I'm trying to do is have it detect if the customer ID is cash customer, then if it is, open the notes form if the notes field is blank and tell them that they need to enter the user information there. If the notes section isn't blank, it'll close the form and continue to print the service ticket out that we attach to computers. Here's the code
"
Dim stDocName As String
Dim stDocName2 As String
Dim stDocName3 As String
Dim stLinkCriteria As String
stDocName = "Print"
stDocName2 = "Service Record"
stDocName3 = "Notes"
If [newcheck] = True And [CustomerID] = "CASH COUNTER CUSTOMER" Then
DoEvents
stLinkCriteria = "[Service Number]=" & Me![Service Number]
DoCmd.OpenForm stDocName3, , , stLinkCriteria
If [Notes] = Null Then
MsgBox "Please enter the name of the cash customer in the notes, thank you
Else
DoCmd.Close acForm, "Notes", acSaveYes
End If
End If
If [newcheck] = True Then
DoEvents
stLinkCriteria = "[Service Number]=" & Me![Service Number]
DoCmd.OpenForm stDocName2, , , stLinkCriteria
DoCmd.RunMacro stDocName
DoCmd.RunCommand acCmdPrint
ElseIf [newcheck] = False Then
MsgBox "This is not a new customer, will not e-mail"
stLinkCriteria = "[Service Number]=" & Me![Service Number]
DoCmd.OpenForm stDocName2, , , stLinkCriteria
End If
"
Pardon me for my crappy programming skills, i've only had one semester of VB two years ago and i Haven't messed with it since
Thanks!