General discussion

Locked

Access: Overwriting default form values

By Gregg S ·
I use a form for data entry that has several fields that contain dates. I would like for these fields to contain default values that are the same as one main date. However, I need to be able to change these dates as needed, if the default value isnot correct for the situation. How do I accomplish this?

This conversation is currently closed to new comments.

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

All Comments

Collapse -

Access: Overwriting default form values

by crispy1 In reply to Access: Overwriting defa ...

I am not much of an access person, usually work with MS SQL. Are you looking to do something like the following:
You have 3 situations and for each of those situations there needs to be a different default date, therefore 3 different default dates based on the situation. Is it possible to create 3 different forms, one for each situation, and use a different default date? Can you use an if statement to programatically check for the date?
Like I said, not extremely knowledgable when it comes to access, I am use to MS SQL and asp.net.

Collapse -

Access: Overwriting default form values

by Gregg S In reply to Access: Overwriting defa ...

The table behind the form is a customer order table. There are several date fields in each record. I would like each of the date fields be filled with a default value based upon one chosen field, which would always be the same field, but not the same value. However, if the default value in some of these date fields is not correct for the order, I must be able to change it. I am operating on the theory that a default value appropriate to the order is better than a blank. Then when a correctdate is determined, it will then be updated.

It may very well be able to be accomplished progrmatically, but I am not experienced enough to know how to do it. I, too, need more knowledge of Access--I just know enough to get dangerous!

Collapse -

Access: Overwriting default form values

by tlgilliamnz In reply to Access: Overwriting defa ...

Greg - In design view, goto the field you want to use for the main date. Select the properties button and select "On Exit" for a "Event Procedure". Select code and Type in like this: me!"yourfieldname".setfocus
me!"yourfieldname" = me!"maindatefieldname"
me!"yourfieldname2".setfocus
me!"yourfieldname2" = me!"maindatefieldname"
You can use this for and number of date fields.
Once updated set the focus to what ever field is next in your form. You can not update the form field with out havingthe field have the sole focus.

Collapse -

Access: Overwriting default form values

by Gregg S In reply to Access: Overwriting defa ...

I believe Answer 2 is on the right track, but I am having problems with it. My first problem is that I get ther error message "Run-time error '438' Object does not support this property or method" on the first line. I did insert the name of my field for "yourfieldname". Any suggetions?

Collapse -

by Gregg S In reply to Access: Overwriting defa ...

I am closing due to lack of activity.

Collapse -

by Gregg S In reply to Access: Overwriting defa ...

This question was closed by the author

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

Related Discussions

Related Forums