As you haven't started your new post yet:
No, the example is as is... your iX has the integer value assigned to it from earlier in your code.
The following is an example taken from part of a code I use to update a particular record in an actual database that I use in production to track 100's of containers:
The code is in a form (frm_qaqc_updatestate) which is opened from another form that deals with the actual container information (note that is is only a few lines out of many as there is validation and signiture and on and on and on involved with updating a container's status).
I've placed the subparts of the string on seperate lines so you can see how they relate:
- zsqlstring =
-
"UPDATE
-
tbl_tmp_qaqchold
-
SET
-
qaqcstat = '" & z_str_cbobx_qaqcstat & "'
-
WHERE
-
ContainerRecord_id_pk = " & z_int_addtolist
-
zdb.Execute zsqlstring, dbFailOnError
now normally zsqlstring would be all on one line.
On line 5: "qaqcstat" is text field in the tbl_tmp_qaqchold, that will be set to a string value taken from a form control - notice the single quotes " ' " - if it were a date then the " ' " would be replaced by a pound sign "#" an integer would be as on....
.... On line 7: ContainerRecord_id_pk is a field in tbl_tmp_qaqchold, it is a long integer (actually an autonumber field used to track the containers but that's another story). Notice how z_int_addtolist just hangs there? z_int_addtolist was set earlier in the form to be the integer id for the container.
SO let's say the lab is updateing the qaqcstatus for container 23 to hold:
z_int_addtolist = 23
z_str_cbobx_qaqcstat = hold
so if you were to insert DEBUG.PRINT zsqlstring between lines 7 and 8 then in the immedate window you would get:
- UPDATE tbl_tmp_qaqchold SET qaqcstat = 'Hold' WHERE ContainerRecord_id_pk = 23
There you have it.
-z