Variables

simongallop

Registered User.
Local time
Today, 02:28
Joined
Oct 17, 2000
Messages
611
On a form, I have lots of comboboxes where column(0) = ID Number.
Next to each combobox there is a textbox.
I need to assign the information from the textbox to a variable.

The problem is that I want the variable to have the name Lx where x is the ID number from the combobox. So something like: L & me.cmb1.column(0) = me.txtBox1
Of course that doesn't work.
Does anybody know the code, if there is any, otherwise it will have to be lots of if statements!!

Thanks in advance
 
What is it you are trying to do Simon, there may be an workaround that might come to light with a bit more info...
 
The basic answer is that there have been the odd occasion over the past few years where it would be easier to call variables based on selected information.

This time I have 2 places where I need the above answer. The first is 22 names in a list and 22 comboboxes, making sure that each one is unique (Formula1, drivers and finishing positions!). Got around it through verbose if statements.
2nd case is saying If nth driver finished the race then 10 points to his team. Finished marked by option button next to positions comboboxes. Idealy use team_id from combobox to then add 10 to team variable before filling team_table.
At present I am trying to use textboxes where the TAG is named after each team, adding the points to the relevant textbox, then getting the code to fill the table!

[This message has been edited by simongallop (edited 02-22-2001).]
 
I'm not sure whether I am following you but if what you are trying to do is to pass the IDNumber(Team Ref) and pts through for the team. I'd use a sub to pass the info then take the appropriate action based on the parameters provided. I'm not well up on writing module code but would assume that it would be something like this:

One passed as a string you can add the 'L' at the start if it's needed.

fUpdateTeams(strTeams as string,bytPoints as byte)

In the code you'd use DAO to fill the two fields and other required fields using the .AddNew method.

I think you already know this though and I may be barking up entirely the wrong tree.

Ian

[This message has been edited by Fornatian (edited 02-22-2001).]
 
A question occurred to me, do you have 22 combo box fields in a table or do you create 22 records per race?

Seems to me the easiest way to build the database would be to have a 1:M relationship between Races and Drivers/Points, while the Drivers would have a M:1 relationship with Teams.
It may be a problem with how the database is normalised which is forcing the excessive coding and problems.

Unfortunately that doesn't answer your original question Simon.
 

Users who are viewing this thread

Back
Top Bottom