Data input form memory of previous entry for some fields

dlambert

Member
Local time
Today, 16:46
Joined
Apr 16, 2020
Messages
42
Hello All,
I am trying to get the following to work:
Data input form with the following fields:
1 - CustomerName (combobox from a table)
2 - JobNumber (combobox from a query)
3 - Employee (combobox from a query)
4 - WorkDate
5 - WorkDescription
6 - WorkHours
All the above data is to go into a table called tblWorkHoursInput with corresponding columns
When the data is being entered, most of the time fields 1,2,3,4 will stay the same for multiple entries (with variations in fields 5 and 6).
What I would ideally like to achieve is a way that i can fill all the fields then press a button that would add the corresponding record, and automatically clear fields 5 and 6 so the new data can be inputted before pressing the same button again to add another record. In between entries i could change any of the fields 1,2,3,4 as required and it would then be remembered for the next record.
Any suggestions on the best to go to achieve this?
Any help if much appreciated.
 
I store the data in the control.tag.
tag property is the 'free parking' for anything.

'save values
txtCustName.tag = txtCustName
txtJobNum.tag =txtJobNum
etc...

then new record, load them back:
txtCustName= txtCustName.tag
txtJobNum=txtJobNum.tag
 
I used this method

Code:
Private Sub Date_ID_AfterUpdate()
    If Me.chkCopy Then
        Me![Date_ID].DefaultValue = """" & Me![Date_ID].Value & """"
    Else
        Me![Date_ID].DefaultValue = 0
    End If
End Sub
 
or you can use the Form's BeforeUpdate event to set the DefaultValues of the controls.
 
Hi. If data in 1 to 4 repeat, then perhaps they belong in a parent table?
 
parent query if they can be joined.
 

Users who are viewing this thread

Back
Top Bottom