Whats wrong with this code?? A97 XP SP2



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
--
Kahuna
------------


.



Relevant Pages

  • Re: Whats wrong with this code?? A97 XP SP2
    ... You should be issuing a Debug.Print on *all* of your sql statements so you can easily see where the errors are. ... > routine should use Like (for wildcards) ... > Just working on the first part of the If - Loop for now. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Whats wrong with this code?? A97 XP SP2
    ... Dan Artuso, MVP ... > routine should use Like (for wildcards) ... > Just working on the first part of the If - Loop for now. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Whats wrong with this code?? A97 XP SP2
    ... Thanks Dan - that makes sense, seems like there should be an easier way to ... and this is the first run for the routine. ... >> routine should use Like (for wildcards) ... >> Just working on the first part of the If - Loop for now. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Speed Speed Speed - Cutting down on wasted cycles
    ... result of my ignorance on how to best utilize VB6 coding techniques. ... So I had two sections within this one routine that were slowing ... I tacked first the Recordset issue first. ... Now I'm down to a loop that has to perform extensive date manipulation ...
    (microsoft.public.vb.general.discussion)
  • Re: Using ZLib
    ... >> If only it were so easy - I tried using a repeat..until loop, ... >when Count>bytes left, inflate() sets FZRec.avail_out to 0, otherwise ... the main exit condition, and suggest that you check your Delphi CD. ... routine to ensure that they are asking for /exactly/ the decompressed ...
    (comp.lang.pascal.delphi.misc)