new data-entry form - make default selection

G

Guest

Hello,

I have a form that is set to data-entry "True" so that the user can only
enter new records, and not view or change previous entered records.

I have about 10 fields, on the form and would like the first two fields that
when selected on the first entry, become the default for all subsequent
entries until the form is closed. Is this possible? Would it be better to
have a form pop up before starting to enter data that would have the user
make the selections for those two fields first, and once selected, would
become the default selection for those two same fields on the data entry form?

Want to make selection of Department and Document Type default once selected
at the first entry. Fields are "DeptID" and "DocType" and form name is
"frmaddnewdoc " Also, if possible to make first two fields entry become
defaults, on second record entry, would it be possible that the cursor goes
straight to the 3rd field as well as afor all subsequent entries until the
form is closed? Third field is called "DocTrack#"

Thank you.

Sincerely,

Jean-Francois Gauthier
 
M

Marshall Barton

Jean-Francois Gauthier said:
I have a form that is set to data-entry "True" so that the user can only
enter new records, and not view or change previous entered records.

I have about 10 fields, on the form and would like the first two fields that
when selected on the first entry, become the default for all subsequent
entries until the form is closed. Is this possible? Would it be better to
have a form pop up before starting to enter data that would have the user
make the selections for those two fields first, and once selected, would
become the default selection for those two same fields on the data entry form?

Want to make selection of Department and Document Type default once selected
at the first entry. Fields are "DeptID" and "DocType" and form name is
"frmaddnewdoc " Also, if possible to make first two fields entry become
defaults, on second record entry, would it be possible that the cursor goes
straight to the 3rd field as well as afor all subsequent entries until the
form is closed? Third field is called "DocTrack#"


The data type of the fields is critical to setting the
defaults. Use the control's AfterUpdate event procedure to
set its own DefaultValue property:

For a numeric type field:
Me.DeptID.DefaultValue = Me.DeptID

For a Text field:
Me.DeptID.DefaultValue = """" & Me.DeptID & """"

For a DateTime field:
Me.DeptID.DefaultValue = Format(Me.DeptID, "\#m\/d\/yyyy\#")

Use the same kind of thing in the DocType text box's
AfterUpdate event.

To skip those controls on subsequent records, use the form's
Current event:
If Me.DeptID.DefaultValue <> "" Then Me.[DocTrack#].SetFocus
 
G

Guest

Hi Marshall,

Thank you for your reply. When I input this code in the event "After
Update" procedure, and I try to use the form, it tells me that the macro Me
does not exist. What is such a macro that I would need to have in my
database?

Thank you.

Sincerely,

Jean-Francois Gauthier

Marshall Barton said:
Jean-Francois Gauthier said:
I have a form that is set to data-entry "True" so that the user can only
enter new records, and not view or change previous entered records.

I have about 10 fields, on the form and would like the first two fields that
when selected on the first entry, become the default for all subsequent
entries until the form is closed. Is this possible? Would it be better to
have a form pop up before starting to enter data that would have the user
make the selections for those two fields first, and once selected, would
become the default selection for those two same fields on the data entry form?

Want to make selection of Department and Document Type default once selected
at the first entry. Fields are "DeptID" and "DocType" and form name is
"frmaddnewdoc " Also, if possible to make first two fields entry become
defaults, on second record entry, would it be possible that the cursor goes
straight to the 3rd field as well as afor all subsequent entries until the
form is closed? Third field is called "DocTrack#"


The data type of the fields is critical to setting the
defaults. Use the control's AfterUpdate event procedure to
set its own DefaultValue property:

For a numeric type field:
Me.DeptID.DefaultValue = Me.DeptID

For a Text field:
Me.DeptID.DefaultValue = """" & Me.DeptID & """"

For a DateTime field:
Me.DeptID.DefaultValue = Format(Me.DeptID, "\#m\/d\/yyyy\#")

Use the same kind of thing in the DocType text box's
AfterUpdate event.

To skip those controls on subsequent records, use the form's
Current event:
If Me.DeptID.DefaultValue <> "" Then Me.[DocTrack#].SetFocus
 
M

Marshall Barton

It sounds like you put the code in the AfterUpdate PROPERTY,
instead of the event PROCEDURE. The property must have:
[Event Procedure]
then use the code builder button (with three dots) to open
the module and position the cursor in the event procedure.
--
Marsh
MVP [MS Access]


Jean-Francois Gauthier said:
Thank you for your reply. When I input this code in the event "After
Update" procedure, and I try to use the form, it tells me that the macro Me
does not exist. What is such a macro that I would need to have in my
database?


Marshall Barton said:
Jean-Francois Gauthier said:
I have a form that is set to data-entry "True" so that the user can only
enter new records, and not view or change previous entered records.

I have about 10 fields, on the form and would like the first two fields that
when selected on the first entry, become the default for all subsequent
entries until the form is closed. Is this possible? Would it be better to
have a form pop up before starting to enter data that would have the user
make the selections for those two fields first, and once selected, would
become the default selection for those two same fields on the data entry form?

Want to make selection of Department and Document Type default once selected
at the first entry. Fields are "DeptID" and "DocType" and form name is
"frmaddnewdoc " Also, if possible to make first two fields entry become
defaults, on second record entry, would it be possible that the cursor goes
straight to the 3rd field as well as afor all subsequent entries until the
form is closed? Third field is called "DocTrack#"


The data type of the fields is critical to setting the
defaults. Use the control's AfterUpdate event procedure to
set its own DefaultValue property:

For a numeric type field:
Me.DeptID.DefaultValue = Me.DeptID

For a Text field:
Me.DeptID.DefaultValue = """" & Me.DeptID & """"

For a DateTime field:
Me.DeptID.DefaultValue = Format(Me.DeptID, "\#m\/d\/yyyy\#")

Use the same kind of thing in the DocType text box's
AfterUpdate event.

To skip those controls on subsequent records, use the form's
Current event:
If Me.DeptID.DefaultValue <> "" Then Me.[DocTrack#].SetFocus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top