|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Trouble Compiling - PLEASE HELP
Private Sub Search_Click()
gstrWherePhys = "" If Not IsNothing(Me!LastName) Then gstrWherePhys = "[LastName] Like " & Chr$(34) & Me!LastName If Right$(Me!LastName, 1) = "*" Then gstrWherePhys = gstrWherePhys & Chr$(34) Else gstrWherePhys = gstrWherePhys & "*" & Chr$(34) End If End If If Not IsNothing(Me!FirstName) Then If IsNothing(gstrWherePhys) Then gstrWherePhys = "[FirstName] Like " & Chr$(34) & Me!FirstName Else gstrWherePhys = gstrWherePhys & " AND [FirstName] Like " & Chr$(34) & Me!FirstName End If If Right$(Me!FirstName, 1) = "*" Then gstrWherePhys = gstrWherePhys & Chr$(34) Else gstrWherePhys = gstrWherePhys & "*" & Chr$(34) End If End If If Not IsNothing(Me!City) Then If IsNothing(gstrWherePhys) Then gstrWherePhys = "[City] Like " & Chr$(34) & Me!City Else gstrWherePhys = gstrWherePhys & " AND [City] Like " & Chr$(34) & Me!City End If If Right$(Me!City, 1) = "*" Then gstrWherePhys = gstrWherePhys & Chr$(34) Else gstrWherePhys = gstrWherePhys & "*" & Chr$(34) End If End If If Not IsNothing(Me!Facility) Then If IsNothing(gstrWhereCust) Then gstrWherePhys = "[Facility] Like " & Chr$(34) & Me!State Else gstrWherePhys = gstrWherePhys & " AND [Facility] Like " & Chr$(34) & Me!State End If If Right$(Me!Facility, 1) = "*" Then gstrWherePhys = gstrWherePhys & Chr$(34) Else gstrWherePhys = gstrWherePhys & "*" & Chr$(34) End If End If If Not IsNothing(Me!State) Then If IsNothing(gstrWherePhys) Then gstrWherePhys = "[State] Like " & Chr$(34) & Me!State Else gstrWherePhys = gstrWherePhys & " AND [State] Like " & Chr$(34) & Me!State End If If Right$(Me!State, 1) = "*" Then gstrWherePhys = gstrWherePhys & Chr$(34) Else gstrWherePhys = gstrWherePhys & "*" & Chr$(34) End If End If If IsNothing(gstrWhereCust) Then MsgBox "No criteria specified." Exit Sub End If Me.Visible = False DoCmd.Hourglass True If IsLoaded("PhysicianDB") Forms!PhysicianDB.SetFocus DoCmd.ApplyFilter , gstrWherePhys If Forms!PhysicianDB.RecordsetClone.RecordCount = 0 Then DoCmd.Hourglass False MsgBox "No Customers meet your criteria" Me.Visible = True Exit Sub End If Else DoCmd.Hourglass True DoCmd.OpenForm FormName:="PhysicianDB", WhereCondition:=gstrWherePhys, _ WindowMode:=acHidden If Forms!PhysicianDB.RecordsetClone.RecordCount = 0 Then DoCmd.Hourglass False MsgBox "No Customers meet your criteria" DoCmd.Close acForm, "PhysicianDB" Me.Visible = True Exit Sub End If DoCmd.Hourglass False End If DoCmd.Close acForm, Me.Name End Sub I can't get this to run, could someone please help me out? Thanks |
|
#2
|
|||
|
|||
|
Do you get errors? If so, what line of code causes the errors.
Can you not step through the code with the debugger to identify any problems?
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Trouble Compiling - PLEASE HELP |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|