jackie77
Jackie
- Local time
- Today, 22:18
- Joined
- Jul 18, 2007
- Messages
- 85
Hi All
I'm having a problem getting a bit of code to work :banghead: (see below)
I have done if statements loads of times but I am having a real problem getting this to run without errors, I have changed it round and round different ways but can get it done. I need an if and else statement inside another if and else statement
Would really appreciate if someone could tell me where i'm going wrong
Cheers
Jackie
I'm having a problem getting a bit of code to work :banghead: (see below)
I have done if statements loads of times but I am having a real problem getting this to run without errors, I have changed it round and round different ways but can get it done. I need an if and else statement inside another if and else statement
Would really appreciate if someone could tell me where i'm going wrong
Cheers
Jackie
Code:
[SIZE=3][FONT=Calibri] Private Sub CreateOrder_Click()[/FONT][/SIZE]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Calibri] Dim iline As String[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Dim strMsg As String[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Dim iResponse As String[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Dim iQuote As Integer[/FONT][/SIZE]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Calibri] If Me.AccountHold = -1 Then[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] strMsg = "This account is on Hold! Do you wish to continue?" & Chr(10)[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] iResponse = MsgBox(strMsg, vbQuestion + vbYesNo, "Save Record?")[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] If iResponse = vbYes Then[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] DoCmd.OpenForm "AddJob", acNormal[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Forms("AddJob").CustomerID = Me.CustomerID[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] DoCmd.Close acForm, "AddJobForm1"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] End If[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Exit Sub[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Else[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] If iResponse = vbNo Then[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] End If[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Exit Sub[/FONT][/SIZE]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT]
[FONT=Calibri][SIZE=3]Else[/SIZE][/FONT]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT]
[SIZE=3][FONT=Calibri] If Me.AccountHold = 0 Then[/FONT][/SIZE]
[FONT=Calibri][SIZE=3]DoCmd.OpenForm "AddJob", acNormal[/SIZE][/FONT]
[SIZE=3][FONT=Calibri] Forms("AddJob").CustomerID = Me.CustomerID[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] DoCmd.Close acForm, "AddJobForm1"[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] End If[/FONT][/SIZE]
[SIZE=3][FONT=Calibri] Exit Sub[/FONT][/SIZE]
[FONT=Calibri][SIZE=3] [/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End If[/SIZE][/FONT]
[FONT=Calibri][SIZE=3]End Sub[/SIZE][/FONT]