Question

Locked

Macro in Access 2007 to setvalues on a from with values from another form

By betmck ·
I have a form call [Calculate Gross Pay] which record source is a query call [Gross pay].
Also there is a form call [Payroll] which fields are bound to a table called [payroll].

There are several records on the form[Calculate Gross Pay] and I need all records to be stored in the fields on the form [Payroll].
When I run the macro to populate the records, only the first record is displayed on the [Payroll] form. How do I repeat the Macro until all the records are read?

Macro:
OpenQuery Gross Pay, Datasheet, Edit
OpenForm Calculate Gross Pay, Datasheet, ,,Edit, Normal
OpenForm Payroll, Datasheet, , , Edit, Normal
SetValue [Forms]![Payroll]![PCdate], [Forms]![Calculate Gross Pay]![PayRegDate]
SetValue [Forms]![Payroll]![PCEmp], [Forms]![Calculate Gross Pay]![PrEmpName]
SetValue [Forms]![Payroll]![ PCNISB], [Forms]![Calculate Gross Pay]![ nisb]
SetValue [Forms]![Payroll]![PCNISD], [Forms]![Calculate Gross Pay]![ NISD]
SetValue [Forms]![Payroll]![PCpaye], [Forms]![Calculate Gross Pay]![ PAYE]
GoToRecord Form, Calculate Gross Pay, Next,

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums