Xiazer
02-06-2009, 11:40 AM
I have two recordsets that I am trying to compare two lists of 5 things. So is this possible?
If ViewPicks("# " + placeholder + " Prediction") = Forms Then
Note: I have this working when I don't try to use the placeholder variable.
Did I do it wrong?
lagbolt
02-06-2009, 01:32 PM
Yo X:
You haven't provided enough information for anyone to help you.
Describe the problem in extreme detail.
What it the 'placeholder?' What is ViewPicks()? When it fails, how do you know? Error? Wrong answer?
All the best,
Xiazer
02-09-2009, 06:35 AM
The code it self works when presented like this
If ViewPicks("# 1 Prediction") = Forms Then
I just want to know if it is possible to fit this in a loop where the number within "ViewPicks(# 1 Prediction")" can be changed with a placeholder variable so on the next loop it would be read as "ViewPicks(# 2 Prediction")" and so on.
Although ViewPicks is a recordset. and "Number 1" is a textbox and the error I get is "Run-tim error '13': Type Mismatch.
Thanks again.
Q
DCrake
02-10-2009, 12:40 AM
You need to structure your variables correctly
If ViewPicks("# " & placeholder & " Prediction") .....
Xiazer
02-10-2009, 09:01 AM
Thanks for the help! I finally got it to work, Turns out I needed to set it to a variable then put it in the loop to get it to work, I couldn't set it inside the if statement like this:
TableContents = "# " & PickNumber & " Prediction"
FormContents = "Number " & PickNumber
...
If StrComp(ViewPicks(TableContents), Forms, 1) Then
Thanks again!
Q