Cannot disply the value into foem after run the marco

yukileong

New member
Local time
Today, 13:05
Joined
Jul 17, 2014
Messages
3
Hi, i facing the problem when run the marco and cannot display the value into main form.

i use marco to run the sumofworkloadperworker (subform) to text box name workload (mainform).
However, after i click the marco button. Its seems marco have function but do not disply the amount of (sumofworkloadperworker) in text box name workload (mainform).

The action for run the marco was following:

Set warning On No

Open query
Query Name : qrySumOfWorkloadByInvoice

Open query
Query Name : qryUpdateWorkloadAmount

Repaint Object
Object Name ; Audit fees main form


Attachment documents-View attachment 8.zip


Anyone can help me...?
Thanks...
 
Try adding a ReQuery to the macro to refresh the data after you have updated it
 
Try adding a ReQuery to the macro to refresh the data after you have updated it

After i adding a requery.what i need to put into control name?

isnt put the field name that i want update into mainform?

Besides that, after i rerun the marco, its show a error message.

The object " auditfees (main form) '" isn't open
*the marco you are runninh contains a Goto Record or selected object action but the object name argument names an object that is closed.
* The object name argument for the go to record, repaint object, or selected object method name an object that is closes.

Use one of the actions or methods to open the object


How i was settle this error message?

Thanks...
 
I assume the RePaint command in your Macro refers to a form called 'Audit fees main form'. From your description I think you need to ReQuery / Refresh the form where your text box 'WorkLoad' is located. This form should be open.

How do you invoke the Macro to carry out this function, if it is on a button click on the form you can add the code to the VBA code after invoking the macro

Code:
Me.Form.Requery

This will refresh the form and display the results of the query.
 
I assume the RePaint command in your Macro refers to a form called 'Audit fees main form'. From your description I think you need to ReQuery / Refresh the form where your text box 'WorkLoad' is located. This form should be open.

How do you invoke the Macro to carry out this function, if it is on a button click on the form you can add the code to the VBA code after invoking the macro

Code:
Me.Form.Requery

This will refresh the form and display the results of the query.


hi, after i add the code to the VBA code after invoking the macro . It will came out a warning message when i want key the information to subform

The link master field property setting has procedure this error: 'Invalid outside procedure"

why will like this?

However,if i do not add the code to the VBA code after invoking the macro. that the value can update to text box 'Workload" for first time. It do not work if want to add new information or invoice.

Thanks...
Attachment document View attachment 10.zip- Please refer audit fees form
 
I am not sure what you are trying to achieve.

What is the Criteria [I #] you input into the query, I assume this is the Invoice ID fromthe form, in which case you would be better constructibng the query SQL code within a VBA procedure and using the Invoice ID from the form as criteria for the query. See http://www.fontstuff.com/access/acctut17.htm for details.

VBA Code is far more flexible than using a Macro which is very limited.
 

Users who are viewing this thread

Back
Top Bottom