K
Kahuna
Hi Folks - been round the houses with this code before I am sure, but once
again have a query in code that seems to think there are parameters to
fulfil!
Here's the code:
'Loop through all Library data
Do While Not rs_LibraryData.EOF
If rs_LibraryData![ccr_use_serv_cd] = True Then ' If
Service Code is to be used
str_field_to_apply = "lb_label_1"
'****************************************
str_ccr_to_apply = rs_LibraryData![ccr_ccr]
If rs_LibraryData![ccr_like] = True Then ' If the
routine should use Like (for wildcards)
strSQL_to_run = "UPDATE qryFabricCondition SET
qryFabricCondition.fc_ccr_value = [str_ccr_to_apply]" _
& " WHERE (((qryFabricCondition.lb_label_1)=
Like & [str_field_to_apply] & " * "))"
Else ' If Not
Like
strSQL_to_run = "UPDATE qryFabricCondition SET
qryFabricCondition.fc_ccr_value = [str_ccr_to_apply]" _
& " WHERE (((qryFabricCondition.lb_label_1)=
[str_field_to_apply]))"
End If
'****************************************
Else ' If
Component to be used instead
'str_field_to_apply = "fc_main1"
'****************************************
'If rs_LibraryData![ccr_like] = True Then ' If the
routine should use Like (for wildcards)
'strSQL_to_run = ""
'Else ' If Not
Like
'strSQL_to_run = ""
'End If
'****************************************
End If
MsgBox strSQL_to_run
DoCmd.RunSQL (strSQL_to_run)
If rs_LibraryData.EOF Then Exit Do
Loop
Just working on the first part of the If - Loop for now.
************************************************************************************
strSQL_to_run = "UPDATE qryFabricCondition SET
qryFabricCondition.fc_ccr_value = [str_ccr_to_apply]" _
& " WHERE (((qryFabricCondition.lb_label_1)=
[str_field_to_apply]))"
************************************************************************************
This section is the first piece of offending code - and raises a parameter
input box. even though the variables have the correct information in them. I
seem to recall that A97 will not define the parameters in code and needs
some extra input to define the parameters.
Any help on what and where to input this code would be appreciated.
Cheers
again have a query in code that seems to think there are parameters to
fulfil!
Here's the code:
'Loop through all Library data
Do While Not rs_LibraryData.EOF
If rs_LibraryData![ccr_use_serv_cd] = True Then ' If
Service Code is to be used
str_field_to_apply = "lb_label_1"
'****************************************
str_ccr_to_apply = rs_LibraryData![ccr_ccr]
If rs_LibraryData![ccr_like] = True Then ' If the
routine should use Like (for wildcards)
strSQL_to_run = "UPDATE qryFabricCondition SET
qryFabricCondition.fc_ccr_value = [str_ccr_to_apply]" _
& " WHERE (((qryFabricCondition.lb_label_1)=
Like & [str_field_to_apply] & " * "))"
Else ' If Not
Like
strSQL_to_run = "UPDATE qryFabricCondition SET
qryFabricCondition.fc_ccr_value = [str_ccr_to_apply]" _
& " WHERE (((qryFabricCondition.lb_label_1)=
[str_field_to_apply]))"
End If
'****************************************
Else ' If
Component to be used instead
'str_field_to_apply = "fc_main1"
'****************************************
'If rs_LibraryData![ccr_like] = True Then ' If the
routine should use Like (for wildcards)
'strSQL_to_run = ""
'Else ' If Not
Like
'strSQL_to_run = ""
'End If
'****************************************
End If
MsgBox strSQL_to_run
DoCmd.RunSQL (strSQL_to_run)
If rs_LibraryData.EOF Then Exit Do
Loop
Just working on the first part of the If - Loop for now.
************************************************************************************
strSQL_to_run = "UPDATE qryFabricCondition SET
qryFabricCondition.fc_ccr_value = [str_ccr_to_apply]" _
& " WHERE (((qryFabricCondition.lb_label_1)=
[str_field_to_apply]))"
************************************************************************************
This section is the first piece of offending code - and raises a parameter
input box. even though the variables have the correct information in them. I
seem to recall that A97 will not define the parameters in code and needs
some extra input to define the parameters.
Any help on what and where to input this code would be appreciated.
Cheers