Avoid Re-Typing Information

G

Guest

I need a little help with a form.

My form is based on a table with the following fields:

ID
Stager
Door
Store #
Trailer #
Open Date/Time
CLosed Date/Time
Seal #
# Licenses

We are keying entries off of a log sheet that contains the same information
that is filled out by a warehouse worker. Each person could have 50-100
entries on their sheet. Currently, the form is set up so that the Date and
ID must be entered for each line entry. Is there a way to set up a form that
will only ask for the date and ID one time, and allow the rest of the
information to be added without retyping the Date and ID for each line?

Thanks is advance for your help.

Linda
 
G

Guest

Boz,

When you find yourself entering redundant data, it may be a red flag that
your tables might have a more efficient design. If there are many items on
each log sheet, and the worker is represented by your Stager field, a better
design might be:

Logs
------------------
LogID AutoNumber (Primary Key)
Stager Number (Foreign Key to Stagers)
LogDate Date/Time

LogItems
------------------
LogItemID AutoNumber (Primary Key)
Door
Store #
Trailer #
CLosed Date/Time
Seal #
# Licenses

Entry could then be done by a main form based on Logs with an embedded
continuous subform based on LogItems, linked by the LogID.

If this does not match your requirements, you can also use the AfterUpdate
event of both the date and worker fields to set a new DefaultValue for the
field:

Me![YourField].DefaultValue = Me![YourField]

Hope that helps.
Sprinks
 
G

Guest

Sprinks is correct. If, however, you are not able to redesign your database
structure. You can achieve what you want by using a little form trick. Make
the actual text boxes that are bound to the ID and Date invisible. Create
two unbound check boxes to allow the user to enter them. Then use the form
Current event to manage the process:

blnGotMinimum = True
If Me.NewRecord Then
If IsNull(Me.txtIdEntry) Then
MsgBox "ID Required"
Me.txtIdEntry.SetFocus
ElseIf IsNull(Me.txtDateEntry) Then
MsgBox "Date Required"
Me.txtDateEntry.SetFocus
Else
Me.txtStager.SetFocus
End If
Else
Me.txtIdEntry.Setfocus
End If

Also, you will need to populate the bound controls once the entry controls
are updated. Use the After Update event for each:

Me.txtIdBound = Me.txtIdEntry

Same for the date entry control.
 

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