atmospherik
Technical User
I have a form which displays a product image if the 'stockcode.jpg' exists in a particular folder.
The stockcode is a 'manually coded' sequential number - this is currently generated (getting the next in the sequence from another table) when the BeforeInsert event fires - therefore only *new* records get the stockcode generated. The default value is -1 before it's generated.
Currently the script to check if the image exists (and display it) is fired from the onCurrent event.
My problem is this -
when the user adds a new record the stock code shows -1 initially. The image isn't displayed until moving away from the record and coming back to it. I'd like to fire the display image onCurrent aswell but it needs to be done *after* generating the stockcode.
If I want to generate the stockcode onCurrent so that the image can be immediately displayed then I need to check if the stockcode has been generated already. When I check it, it doesnt hold value -1 (I assume this is because the record hasn't been saved at this point) it seems to hold nothing (or is undefined??) so I can't see if I need to generate a stockcode...!
Phew.
If anyone can understand my ramblings above then i'd be very grateful for any advice. As you might tell i'm no Access or VB expert!
Paul
The stockcode is a 'manually coded' sequential number - this is currently generated (getting the next in the sequence from another table) when the BeforeInsert event fires - therefore only *new* records get the stockcode generated. The default value is -1 before it's generated.
Currently the script to check if the image exists (and display it) is fired from the onCurrent event.
My problem is this -
when the user adds a new record the stock code shows -1 initially. The image isn't displayed until moving away from the record and coming back to it. I'd like to fire the display image onCurrent aswell but it needs to be done *after* generating the stockcode.
If I want to generate the stockcode onCurrent so that the image can be immediately displayed then I need to check if the stockcode has been generated already. When I check it, it doesnt hold value -1 (I assume this is because the record hasn't been saved at this point) it seems to hold nothing (or is undefined??) so I can't see if I need to generate a stockcode...!
Phew.
If anyone can understand my ramblings above then i'd be very grateful for any advice. As you might tell i'm no Access or VB expert!
Paul