Form for mass entry

tmyers

Well-known member
Local time
Today, 05:42
Joined
Sep 8, 2020
Messages
1,091
In my app for sending cuts of electrical wire to our wire room to be cut, I have a form that the sales people fill out before sending the request back. It consist of a header that has several required fields to be filled out and saved before the sub-forms with the actual data entry become active (in my view the sub-forms are always active regardless). Below is a snip of the form just for reference.

The issue a user has reported is when they have the same request dozens of times, it is very time consuming to have to fill out the header every single time. An example would be a single cut of wire that is the same across 50 sales registers, so as far as the header is concerned, the only thing changing is the sales register number and everything else remains the same. As the form currently is, they would have to submit each cut individually and reset the form and fill it out again over and over, which as you can see would be very time consuming.

What would be the best method to handle this? Should I create a different form for the entry of these request? The first thought I had was using DAO and recordset.clone to replicate the request over and over depending on how many times to user determines it needs done and simply update the sales register number each time using register numbers the user enters separated by a comma, so they would enter 1234,5678,1347,3547 and that would cause the record to be cloned 4 times with the register number being updated to each entry accordingly.

1666697367049.png
 
I had to enter over 25k records for a database of mine, where several fields were the same for about 20 records each time.
I had a checkbox that I set when I wanted to copy over the previous record data.
That way if I did not want that to happen, I just cleared it, as I had it set as true as default.
 
How did you manage that by using just a check box? Did you just clone the record in the event the value was set to true?
 
Thanks Gas! I finally got to sit back down and can sift through this and will report back!
 
Here is how I did it, from AB's site
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

Private Sub Form_Activate()
'Refresh_Click
End Sub

Private Sub Rank_ID_AfterUpdate()
    If Me.chkCopy Then
        Me![Rank_ID].DefaultValue = """" & Me![Rank_ID].Value & """"
    Else
        Me![Rank_ID].DefaultValue = 0
    End If

End Sub
chkCopy was my checkbox.
1666723113070.png
 
There are a few options of how to save a record so you can easily copy it. The two simplest are to use the Tag property of the control or to use the default value. If you have natural defaults, then using the tag property would be best. You could also use TempVars if both the default and Tag properties have existing uses.
In the form's AfterUpdate event:

Me.fld1.Tag = Me.fld1
Me.fld2.Tag = Me.fld2
Me.fld3.Tab = Me.fld3

Then on the form add a button that says to copy. That code would be:
Code:
If Me.fld1.Tag & "" = "" Then
    Msgbox "there is no previous record saved so copy is not currently available.",vbOKOnly
Else
    Me.fld1 = Me.fld1.Tag
    Me.fld2 = Me.fld2.Tag
    ....
End If

Just don't copy the sales register number. It needs to be blank so the user can fill it in.
 

Users who are viewing this thread

Back
Top Bottom