A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

DATA FROM RECORDS ON SUBFORM



 
 
Thread Tools Display Modes
  #11  
Old September 7th, 2008, 08:32 AM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default 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  
Old September 7th, 2008, 03:37 PM posted to microsoft.public.access.forms
hogan
external usenet poster
 
Posts: 31
Default 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  
Old September 8th, 2008, 08:58 AM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default 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  
Old September 9th, 2008, 12:51 AM posted to microsoft.public.access.forms
hogan
external usenet poster
 
Posts: 31
Default 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  
Old September 9th, 2008, 07:18 AM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default 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  
Old September 10th, 2008, 07:12 AM posted to microsoft.public.access.forms
hogan
external usenet poster
 
Posts: 31
Default 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  
Old September 11th, 2008, 09:10 AM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default 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  
Old September 17th, 2008, 01:43 AM posted to microsoft.public.access.forms
hogan
external usenet poster
 
Posts: 31
Default 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  
Old September 20th, 2008, 08:34 PM posted to microsoft.public.access.forms
Steve Schapel
external usenet poster
 
Posts: 1,422
Default 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  
Old September 27th, 2008, 02:37 AM posted to microsoft.public.access.forms
hogan
external usenet poster
 
Posts: 31
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 05:24 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.