General discussion

Locked

Update on 'Access 97 form troubles'

By Logic2 Tech ·
View "Access 97 form troubles"
- - - posted on - - 6/30
- - - now closed for this post

The problem with what we're trying to do is:

the user is to view and fill out the form in ADD MODE which doesn't do the calculation of finding the highest 'job number' and designating the next one. It does this calculation in EDIT MODE.

Our first solution was to use a macro in the switchbox to open the form in 'edit mode' to do the calculation And open the form in 'add mode' so the user can do what needs done...Problem...well...this works perfectly...except the calculation takes longer(over 20,000 records) to finish than it does for the 'add mode' form does to load.

So, our first thought was 'try to halt the 'add mode' form until the calculation completes... If there is a way, it's not one that we tried. We tried some basic VB code entered directly into the form... no go ...my code knowledge is still limited to verrrrry basic stuff and my partner's in next to zip. Maybe a macro ofsome kind...no luck

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Update on 'Access 97 form troubles'

by spammy In reply to Update on 'Access 97 form ...

Trust me, this will work in both Add and Edit modes.

Go to the control that holds the Job Number on your form and add this code to the Default Value property box:

=DMax("[FieldName]","TableName")+1

Replace [FieldName] with the name of your Job Number field and replace "TableName" with the table that contains it. (Be sure to add all the quotes and brackets just like you see it above.)

The Dmax function will look in the table and find the highest value in the field you give it. It will do this jiffy quick, especially if the field is indexed. It works in either Edit or Add mode.

Please let me know if you have any questions.

D.A. Horn

Collapse -

Update on 'Access 97 form troubles'

by Logic2 Tech In reply to Update on 'Access 97 form ...

Thanks very much for re-posting.
I'm not sure what we did wrong the first time, but it is perfect now.
My partner almost fell out of his chair when he saw it actually working...

Back to Web Development Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums