Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot get a SELECT CASE to work with string values...

Status
Not open for further replies.

MistyWolf

Programmer
Jan 27, 2006
7
0
0
US
Here is the code:

Public Sub setTableName(tblType As String, frmName As String)
Dim rsTBL As DAO.Recordset

Set rsTBL = CurrentDb.OpenRecordset("tblTableConfig", dbOpenDynaset)

With rsTBL
.MoveFirst
.FindFirst "[FormsName] = '" & frmName & "'"

If Not .NoMatch Then
Select Case tblType
Case tblType = "WorkOrder"
mstrWOTable = !WorkOrderTable

Case tblType = "MasterNumber"
mstrMNTable = !MasterNumberTable

Case tblType = "Employee"
mstrEMPTable = !EmployeeTable

End Select
Else
MsgBox "not working"
End If
End With
End Sub

Any thoughts?

MistyWolf
 
Select Case tblType
Case "WorkOrder"
mstrWOTable = !WorkOrderTable
Case "MasterNumber"
mstrMNTable = !MasterNumberTable
Case "Employee"
mstrEMPTable = !EmployeeTable
End Select


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top