play2mefish
New member
- Local time
- Yesterday, 15:07
- Joined
- Oct 7, 2013
- Messages
- 6
Hello everyone, first I would like to thank this board for all of the help I have received before I ever signed up so I could post my questions. Over the years I have always found a solution on this forum for everytime I had a problem. But now I have an issue and I can not for the life of me figure out what is happening and why it isn't working the way I think it should. Here is the code that I'm using for a command button:
Private Sub Command163_Click()
If IsNull([PC_Serial_Number]) Then
MsgBox "This record does not have a serial number."
MsgBox "msg box 1, this is the message after no serial number"
GoTo finish:
End If
If Not Me.PC_Make = "DELL" Then
MsgBox "This is not a DELL Workstation, it is a " & PC_Make & " Workstation!"
MsgBox "msg box 2 , this is the message after not dell"
GoTo finish:
End If
If Me.PC_Make = "DELL" And IsNull(Me.PC_Serial_Number) Then
GoTo finish:
Else
'I know the hyperlinkaddress works but this site would not let me post the hyperlink...this line added for clarification and not part of the code
Me.Command163.HyperlinkAddress =dell website with serial number & Me.PC_Serial_Number
End If
finish:
MsgBox "msg box 3 this is the contents of the last msg box " & Me.PC_Make
End Sub
The problem I'm experiencing is this, While on my form I have a command button that will check to see if the PC_Make is DELL and if there is no serial number, then pop up the message to tell me there is no serial number. Works OK if that is all I do.
If I switch to another record, that has cisco, again it will pop up the message and tell me it is not a dell, and will exit. Works OK if that is all I do.
If I switch to another record that has dell and a serial number in the serial number field, it will follow the hyperlink to dell and to the serial number of the pc. It works OK if that is all I do.
If I check a workstation that has dell and a serial number, then click out of the IE web page, and then switch records, that has cisco listed as pc_make instead of dell, my msgbox will popup and tell me it is not a dell, and when I click OK, it will start the hyperlink with the known last dell and serial number. If I change to another record that has dell and a serial number, it will bring up the new page on DELLs website as advertised. If I switch to another record that has DELL and NO serial number, it will prompt me like it is working, but when I click OK to exit the message, off I go to DELL so it can show me the last record that I clicked that had DELL and a serial number.
I hope this makes sense to someone. I have tried using one IF statement and multiple Else If statements, so far I've gotten the same results no matter how I have tried. The purpose of the extra msgbox 1 and 2 and so forth is so I can tell where I'm at in the code.
Anyway, I'm open to all suggestions and will try anything. Thanks for listening.
Private Sub Command163_Click()
If IsNull([PC_Serial_Number]) Then
MsgBox "This record does not have a serial number."
MsgBox "msg box 1, this is the message after no serial number"
GoTo finish:
End If
If Not Me.PC_Make = "DELL" Then
MsgBox "This is not a DELL Workstation, it is a " & PC_Make & " Workstation!"
MsgBox "msg box 2 , this is the message after not dell"
GoTo finish:
End If
If Me.PC_Make = "DELL" And IsNull(Me.PC_Serial_Number) Then
GoTo finish:
Else
'I know the hyperlinkaddress works but this site would not let me post the hyperlink...this line added for clarification and not part of the code
Me.Command163.HyperlinkAddress =dell website with serial number & Me.PC_Serial_Number
End If
finish:
MsgBox "msg box 3 this is the contents of the last msg box " & Me.PC_Make
End Sub
The problem I'm experiencing is this, While on my form I have a command button that will check to see if the PC_Make is DELL and if there is no serial number, then pop up the message to tell me there is no serial number. Works OK if that is all I do.
If I switch to another record, that has cisco, again it will pop up the message and tell me it is not a dell, and will exit. Works OK if that is all I do.
If I switch to another record that has dell and a serial number in the serial number field, it will follow the hyperlink to dell and to the serial number of the pc. It works OK if that is all I do.
If I check a workstation that has dell and a serial number, then click out of the IE web page, and then switch records, that has cisco listed as pc_make instead of dell, my msgbox will popup and tell me it is not a dell, and when I click OK, it will start the hyperlink with the known last dell and serial number. If I change to another record that has dell and a serial number, it will bring up the new page on DELLs website as advertised. If I switch to another record that has DELL and NO serial number, it will prompt me like it is working, but when I click OK to exit the message, off I go to DELL so it can show me the last record that I clicked that had DELL and a serial number.
I hope this makes sense to someone. I have tried using one IF statement and multiple Else If statements, so far I've gotten the same results no matter how I have tried. The purpose of the extra msgbox 1 and 2 and so forth is so I can tell where I'm at in the code.
Anyway, I'm open to all suggestions and will try anything. Thanks for listening.