S
Stu
Hi
I have a function which is called when a control is clicked and this
function needs to test whether a check box is true or false. The check
box vould be one of several depending on criteria declared when the
form is opened (shift number and process type) so I've declared
variables and these are set at as part of the form open event. When
I'm trying to test the varaible I get a type mismatch as the variable
is declared as a string but that's only the name of the control I want
to test and I can't get the IF statement to test the control itself.
I'm sure this must be possible but I just can't figure out how. Any
help would be appreciated.
Function ExpProcessComplete()
Dim CurDate As Date
Dim strUpdateSQL As String
Dim strRequired As String
Dim strDateField As String
Dim strCompleteField As String
Dim strShiftField As String
Dim strCompFieldTest As String
Dim intOrderQty As Integer
Dim strShift As Integer
Dim strProcess As Integer
CurDate = Date + Time
strShift = Forms!frmOpenProcessInput!frmShift.Value
strProcess = Forms!frmOpenProcessInput!FrmProcess.Value
Select Case strProcess
Case "1" ' Cutting
strRequired = "CutReqd"
strDateField = "CutDate"
strCompleteField = "Cut"
strShiftField = "CutShift"
strPartCompField = "PartCut"
strPartCompQtyField = "PartCutQty"
strPartCompDateField = "PartCutDate"
(.....rest of case statement)
End Select
If (strCompleteField = False) Then
DoCmd.SetWarnings False
It's at this point that I get a type mismatch error.
Thanks
Stu
I have a function which is called when a control is clicked and this
function needs to test whether a check box is true or false. The check
box vould be one of several depending on criteria declared when the
form is opened (shift number and process type) so I've declared
variables and these are set at as part of the form open event. When
I'm trying to test the varaible I get a type mismatch as the variable
is declared as a string but that's only the name of the control I want
to test and I can't get the IF statement to test the control itself.
I'm sure this must be possible but I just can't figure out how. Any
help would be appreciated.
Function ExpProcessComplete()
Dim CurDate As Date
Dim strUpdateSQL As String
Dim strRequired As String
Dim strDateField As String
Dim strCompleteField As String
Dim strShiftField As String
Dim strCompFieldTest As String
Dim intOrderQty As Integer
Dim strShift As Integer
Dim strProcess As Integer
CurDate = Date + Time
strShift = Forms!frmOpenProcessInput!frmShift.Value
strProcess = Forms!frmOpenProcessInput!FrmProcess.Value
Select Case strProcess
Case "1" ' Cutting
strRequired = "CutReqd"
strDateField = "CutDate"
strCompleteField = "Cut"
strShiftField = "CutShift"
strPartCompField = "PartCut"
strPartCompQtyField = "PartCutQty"
strPartCompDateField = "PartCutDate"
(.....rest of case statement)
End Select
If (strCompleteField = False) Then
DoCmd.SetWarnings False
It's at this point that I get a type mismatch error.
Thanks
Stu