Okay. Not sure if whoever reads this has been seeing my other posts lately, but I am working on a database that uses dragging and dropping of labels in order to record events of a process.
I have been trying to create Unique ID's for each label, and previously I was just using the last digits after the name of the labels.
i.e. label names = lblTest1, lblTest2, lblTest3, .... lblTestn.
I then found by help here that I could assign a number to the .tag of the label and manipulate this to create unique ID's for the labels. I have 20 labels and I am recycling them, and when they are deleted I am incrementing the value by 1. This works well until the database is turned off and starting again the next day.
So on the load of the main form, when I am configuring the locations of my labals and there size and other feautes I am running an SQL statement to look back into the table where I am recording the events to see what the last ID was for that specific label is, and if it is there then I am adding 20 and continuing as normal, otherwise I am giving it the ID of the lbl. (incase that label has never been used before).
Here in lies the problem. When I run this in debug mode, stepping through it works a treat. BUT! when i run the form in normal mode it seems to skip over the SQL and just re-assigns it the value of the label. So i go back to the beggining.
I have been told there is a way to force it to finish the SQL query before continuing in the code. Can anyone tell me how?
I have been trying to create Unique ID's for each label, and previously I was just using the last digits after the name of the labels.
i.e. label names = lblTest1, lblTest2, lblTest3, .... lblTestn.
I then found by help here that I could assign a number to the .tag of the label and manipulate this to create unique ID's for the labels. I have 20 labels and I am recycling them, and when they are deleted I am incrementing the value by 1. This works well until the database is turned off and starting again the next day.
So on the load of the main form, when I am configuring the locations of my labals and there size and other feautes I am running an SQL statement to look back into the table where I am recording the events to see what the last ID was for that specific label is, and if it is there then I am adding 20 and continuing as normal, otherwise I am giving it the ID of the lbl. (incase that label has never been used before).
Here in lies the problem. When I run this in debug mode, stepping through it works a treat. BUT! when i run the form in normal mode it seems to skip over the SQL and just re-assigns it the value of the label. So i go back to the beggining.
I have been told there is a way to force it to finish the SQL query before continuing in the code. Can anyone tell me how?