well what im trying to do is take data from a table and put it into a
different table and so im selecting a record from the "oldTable" and then the
way they set up that table is messed up. they have 47 yes/no columns, ex.
GROUP2, GROUP3, GROUP5, GROUP90, so im trying to dynamically get the column
name and then get the value in that column for that current record
Set rstGlobalStateCertifications = crm.OpenRecordset("SELECT * FROM
GlobalStateCertifications")
rstGlobalStateCertifications.MoveFirst
'Loop through the GlobalStateCertifications table records
Do Until rstGlobalStateCertifications.EOF
'check "group" fields for -1 and add to providerstates table
For intNum = 0 To 46
num = numArray(intNum)
temp = "GROUP" & num
queryString = "rstGlobalStateCertifications![" & temp & "]"
Next
rstGlobalStateCertifications.MoveNext
Loop
so im trying to figure out how to evaluate, test it to see if it has a 0 or
-1 in it
is there a way to do this or am i going to have to just make 47 different if
statements to test this (if rstGlobalStateCertifications![GROUP2] = -1
then)???
please help if ya can
:
Try this
' If the variable supplied and it's number
Set rstGlobalStateCertifications = crm.OpenRecordset("SELECT * FROM
GlobalStateCertifications Where MyFieldName =" & MyVariable)
' If the variable supplied and it's string
Set rstGlobalStateCertifications = crm.OpenRecordset("SELECT * FROM
GlobalStateCertifications Where MyFieldName ='" & MyVariable & "'")
' If also the field name supplied then
Set rstGlobalStateCertifications = crm.OpenRecordset("SELECT * FROM
GlobalStateCertifications Where " & MyFieldName & " = " & MyVariable)
:
i am trying to do something like this
Set rstGlobalStateCertifications = crm.OpenRecordset("SELECT * FROM
GlobalStateCertifications")
temp = "GROUP" & num
queryString = Eval("rstGlobalStateCertifications![" & temp & "]")
im trying to access the value in the record's by a certain field or column
but part of the column name i need to be dynamic(num is a variable) but im
not figuring out how to do this, can anyone help me out?