Click to See Complete Forum and Search --> : I"M Desperate!!!


Neiko
September 22nd, 2001, 09:58 PM
If anyone can help me...

Here's my problem. I am trying to convert an application to accept a numeric ID number. ex. 0000072. Right now it uses IT00072. I have the app so it will download my data and put it in the database with a numeric ID. But...I can not get one of the forms to open. This forms function is to display the ID numbers on the tabs, and then allow the user to enter data into the appropiate flex grid. It works great with the IT format, but not the 00. The form will not even open. Heres where I error:

With tbsOccupied.Tabs
.Clear
Do while Not rs.EOF
.Add rs.AbsolutePosition + 1, rs!Site_Number, rs!Site_Number 'ERROR LINE
rs.Move next
Loop
End with

I have never used the Absolute Position, and really don't understand it. I have been struggling with this for days, and if anyone can give me some insite to a solution, I will be most grateful.
Thanks so much
Neiko

Cakkie
September 24th, 2001, 01:10 AM
My guess is that the error you are getting is "Invalid key". This is because the key property MUST be a string that only evaluates to a string. Since the ID is numeric, an error will be raised. To solve this, you need to add at least one alphanumeric character to the key. Try This code:

With tbsOccupied.Tabs
.Clear
Do while Not rs.EOF
.Add rs.AbsolutePosition + 1, "T" & rs!Site_Number, rs!Site_Number 'error LINE
rs.Move next
Loop
End with



Just note when accessing a tab via it's index, you will need to prefix it with a "T".

Tom Cannaerts
slisse@planetinternet.be

Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook