If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Hogan,
You won't be able to run the macro except from the form, if you have a RunCommand/SaveRecord action. The form is the only place where there is a record to save! Leave the Condition blank for the RunCommand/SaveRecord action. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, I do have "" now. Still does not work. When i run the macro from the macro page I get an error saying that saverecord is not available or i'm in a read only db which i am not. Other options than the saverecord runcommand? |
#12
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Steve,
I do run the macro from the form and nothing happens. Well, I can say my msgbox does not appear and I don't know if the record is saving. I do not get the run command error when run from the form though. The query you created works perfectly but my msg is not appearing. "Steve Schapel" wrote: Hogan, You won't be able to run the macro except from the form, if you have a RunCommand/SaveRecord action. The form is the only place where there is a record to save! Leave the Condition blank for the RunCommand/SaveRecord action. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, I do have "" now. Still does not work. When i run the macro from the macro page I get an error saying that saverecord is not available or i'm in a read only db which i am not. Other options than the saverecord runcommand? |
#13
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Hogan,
I think I'd better get you to give a full rundown of exactly what's in the macro, like this: Condition: ... Action: ... Arguments: ... Condition: ... Action: ... Arguments: ... .... etc And also the SQL view of the query, if you can. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, I do run the macro from the form and nothing happens. Well, I can say my msgbox does not appear and I don't know if the record is saving. I do not get the run command error when run from the form though. The query you created works perfectly but my msg is not appearing. |
#14
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Steve,
I was thinking the same. Action: RunCommand Argument: SaveRecord Condition: DLookUp("[All Done]","Query2")0 Action: MsgBox Argument: SERVICE WORK ORDER IS COMPLETE, Yes, Information, Query2 SELECT Count(*)=Abs(Sum([COMPLETED])) AS [ALL DONE] FROM [SKU WORK ORDER] WHERE ((([SKU WORK ORDER].[SERVICE WORKORDER ID])=[Forms]![IN HOUSE SERVICE WORK ORDER]![SERVICE WORK ORDER ID])) Thanks for your help. "Steve Schapel" wrote: Hogan, I think I'd better get you to give a full rundown of exactly what's in the macro, like this: Condition: ... Action: ... Arguments: ... Condition: ... Action: ... Arguments: ... .... etc And also the SQL view of the query, if you can. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, I do run the macro from the form and nothing happens. Well, I can say my msgbox does not appear and I don't know if the record is saving. I do not get the run command error when run from the form though. The query you created works perfectly but my msg is not appearing. |
#15
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Hogan,
Well, as far as I can see, this is what I was expecting. So apparently you have understood and followed my previous suggestions - congratulations! :-) The next thing to do is to open your IN HOUSE SERVICE WORK ORDER form at the required record, and then, at the same time, open Query2 datasheet, and see what is the value of the ALL DONE field. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, I was thinking the same. Action: RunCommand Argument: SaveRecord Condition: DLookUp("[All Done]","Query2")0 Action: MsgBox Argument: SERVICE WORK ORDER IS COMPLETE, Yes, Information, Query2 SELECT Count(*)=Abs(Sum([COMPLETED])) AS [ALL DONE] FROM [SKU WORK ORDER] WHERE ((([SKU WORK ORDER].[SERVICE WORKORDER ID])=[Forms]![IN HOUSE SERVICE WORK ORDER]![SERVICE WORK ORDER ID])) Thanks for your help. |
#16
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Steve,
Would these actions be included in the macro? "Steve Schapel" wrote: Hogan, Well, as far as I can see, this is what I was expecting. So apparently you have understood and followed my previous suggestions - congratulations! :-) The next thing to do is to open your IN HOUSE SERVICE WORK ORDER form at the required record, and then, at the same time, open Query2 datasheet, and see what is the value of the ALL DONE field. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, I was thinking the same. Action: RunCommand Argument: SaveRecord Condition: DLookUp("[All Done]","Query2")0 Action: MsgBox Argument: SERVICE WORK ORDER IS COMPLETE, Yes, Information, Query2 SELECT Count(*)=Abs(Sum([COMPLETED])) AS [ALL DONE] FROM [SKU WORK ORDER] WHERE ((([SKU WORK ORDER].[SERVICE WORKORDER ID])=[Forms]![IN HOUSE SERVICE WORK ORDER]![SERVICE WORK ORDER ID])) Thanks for your help. |
#17
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Hogan,
No. What I am suggesting is a trouble-shooting step. What is the outcome? -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, Would these actions be included in the macro? |
#18
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Steve,
The outcome was -1. "Steve Schapel" wrote: Hogan, No. What I am suggesting is a trouble-shooting step. What is the outcome? -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, Would these actions be included in the macro? |
#19
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Hogan,
I am very sorry, I can't see what the problem is here. Your query is returning a value of -1 so therefore the Condition in your macro should be met, so therefore you should get the message box. I know you already know this (!) but in the absence of anything more intelligent to say I am just repeating the obvious. On the other hand, there has to be an explanation for why it is not behaving as expected. So if it was mine, the next step I would take is put some more MsgBox actions into the macro to try and trace the process that is happening here. So I would put one right at the beginning of the macro, with no Conditions, just to establish that the Event is actually being triggered. And then after the SaveRecord action, another MsgBox (no Condition) and for the message put: =DLookUp("[All Done]","Query2") .. . . expecting that it will be -1 in the message. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, The outcome was -1. |
#20
|
|||
|
|||
DATA FROM RECORDS ON SUBFORM
Steve, I have tried inserting the messages like you said. I get the first
message when the macro triggers but after that I receive an action failed box. Error 2950 if that means anything. I few things i noticed playing around. When I open up the query a parameter box appears asking for the workorder id. I enter an id and I get either -1 or 0. How does the macro know which workorder id to look at. Thanks "Steve Schapel" wrote: Hogan, I am very sorry, I can't see what the problem is here. Your query is returning a value of -1 so therefore the Condition in your macro should be met, so therefore you should get the message box. I know you already know this (!) but in the absence of anything more intelligent to say I am just repeating the obvious. On the other hand, there has to be an explanation for why it is not behaving as expected. So if it was mine, the next step I would take is put some more MsgBox actions into the macro to try and trace the process that is happening here. So I would put one right at the beginning of the macro, with no Conditions, just to establish that the Event is actually being triggered. And then after the SaveRecord action, another MsgBox (no Condition) and for the message put: =DLookUp("[All Done]","Query2") .. . . expecting that it will be -1 in the message. -- Steve Schapel, Microsoft Access MVP hogan wrote: Steve, The outcome was -1. |
|
Thread Tools | |
Display Modes | |
|
|