Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenArgs sometimes NULL, Why?

Status
Not open for further replies.

JoeSmoe55

Programmer
Aug 1, 2005
38
US
Hello,

I have had some wierd things happen with Access Forms. First the linkcriteria is getting passed correctly(set properly in the openform command) when the form_open function is called in the new form the openargs variable is null, why is that? Also some global variables are getting lost somewhere, i have to close the form and open it again. I am trying to get away from useing globals but this is still disconcerting. The only other things is that I have seen the sql fail and rollback the transaction and yet the changes are still saved. I don't get it. One question, when you use docmd.menuitem to save, does it respect transactions(meaning if an error occurs in a seperate sql statement and I rollbakc the transaction, will it also rollback. Also is there a good tutorial somewhere about creating classes in VBA(with inheritance and polymorphism - or their limitations)? I realize that some of my problems might be my programming techniques, I am asking to learning so don't be shy on the criticism(do it in love though :)). Thanks for answering my silly questions.

Questions:
1) lost Open args
2) lost variables
3) flaky transactional stuff
4) building classes in VBA
5) why is the sky blue
6) why do elephants like peanuts
.....

Thanks
JoeSmoe
 
Hi

Taking some of your questions:

1) lost Open args

OpenArgs is not passed by setting the LinkCriteria, it is passed as a paramter of the doCmd.OpenForm command, see help for correct syntax

2) lost variables

Rather difficult to comment on this without seeing trhe circumstances, but in my experience this can happen during debuging, if the the application fails with an error message and you attempt to restart it from a given point, I have not seen it happen in a "production" situation except due to programmer error

3) flaky transactional stuff

Saves of record sets associated with bound forms are outside the scope of an SQL transaction and will not be rolled back. Again I have not seen a situation where (when correctly applied) transaction processing does not work.

Hope that is kind enough for you.

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Ken,


Thanks for your replys. LinkCriteria is another name for openArgs value. None-the-less it is the last arg of the open form command. Sorry for the confusion. Sometimes it passes find sometimes it does not but as you eluded to it might be a debug issue. Thanks for the illumination about the saving of bound forms not being inside the scope of a transaction. It helps me tremendously.

Mike
 

4) Arrgg.

5) Refraction of light differs at different wavelengths

6) They have to eat stupid amounts, and peanuts have a high calorie density
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top