Auto Fill Up Data (2 Viewers)

Hulk009

New member
Local time
Today, 09:09
Joined
Jun 8, 2024
Messages
13
hi
any one can help me writing the correct Vba
I want to run the "Daily" Form and press the button "Fill up All" to set focus in the "R1" Subform and auto fill the data for the day


... setvalue = Peter
go to next
.. set value = charle
end sub
 

Attachments

Just set the controls with those default values in properties.
 
Just set the controls with those default values in properties.
It is a countious form in the sub form. I need to put many more entries everyone on a single record
 
hi
any one can help me writing the correct Vba
I want to run the "Daily" Form and press the button "Fill up All" to set focus in the "R1" Subform and auto fill the data for the day


... setvalue = Peter
go to next
.. set value = charle
end sub
Please check the vba code of the button in the daily form
 
It is a countious form in the sub form. I need to put many more entries everyone on a single record
Does this do what you want?, as the logic seems strange to me. :(
What happens if there is a 3rd person?

Code:
Private Sub Command16_Click()
On Error Resume Next
Forms!Daily.SetFocus
Forms!Daily!R1.SetFocus
DoCmd.GoToRecord , , acNewRec
Me.R1.Form.np = 1
DoCmd.GoToRecord , , acNewRec
Me.R1.Form.np = 2

'Next record
' = Charle
'next



End Sub
 
Does this do what you want?, as the logic seems strange to me. :(
What happens if there is a 3rd person?

Code:
Private Sub Command16_Click()
On Error Resume Next
Forms!Daily.SetFocus
Forms!Daily!R1.SetFocus
DoCmd.GoToRecord , , acNewRec
Me.R1.Form.np = 1
DoCmd.GoToRecord , , acNewRec
Me.R1.Form.np = 2

'Next record
' = Charle
'next



End Sub
it work very good for me . thank you
 
You want to 'batch' create records for all names on particular date, consider:

CurrentDb.Execute "INSERT INTO Daily(IDDate, NameID) SELECT Date(), IDN FROM Names"

Then apply filter to form to return Date() records.

I advise against LOOKUP fields in table.
 

Users who are viewing this thread

Back
Top Bottom