PC Review


Reply
Thread Tools Rate Thread

Automate tasks

 
 
Nigel Molesworth
Guest
Posts: n/a
 
      27th Feb 2006
I've got a data input from on my database. When I have input the data
(often a single item) I then:

close the form
create a report
print the report (a label)
run an update query

The update query (which asks me twice if I'm sure) is to remove a
"print me" flag and put the current date in the date field.

This would be so much easier if I could do it all from the input form,
preferably from a single button, but at this stage I don't know if the
underlying table has been updated with the data.

Even if I had to close the input form first, is it possible to
automate such tasks, as in a macro?

--
Nigel M
 
Reply With Quote
 
 
 
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      27th Feb 2006
The ideal method is to create the report's design first and simply fill it
with data from the form. There are many ways to do this, but here's one of
the simplest (air code):

Sub MyButton_Click()
On Error GoTo Error_Handler
DoCmd.RunCommand acCmdSaveRecord

DoCmd.OpenReport "YourReport",,,,"ID=" & Me.txtIDField

DoCmd.SetWarnings False
DoCmd.OpenQuery "Your Update Query"

Exit_Here:
DoCmd.SetWarnings True
Exit Sub
Error_Handler"
MsgBox " Err.Number & ": " & Err.Description
Resume Exit Here
End Sub

There are better ways of running the update query, but that one is the
simplest.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"Nigel Molesworth" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I've got a data input from on my database. When I have input the data
> (often a single item) I then:
>
> close the form
> create a report
> print the report (a label)
> run an update query
>
> The update query (which asks me twice if I'm sure) is to remove a
> "print me" flag and put the current date in the date field.
>
> This would be so much easier if I could do it all from the input form,
> preferably from a single button, but at this stage I don't know if the
> underlying table has been updated with the data.
>
> Even if I had to close the input form first, is it possible to
> automate such tasks, as in a macro?
>
> --
> Nigel M



 
Reply With Quote
 
Nigel Molesworth
Guest
Posts: n/a
 
      27th Feb 2006
On Mon, 27 Feb 2006 06:22:58 -0500, Arvin Meyer [MVP] wrote:

>The ideal method is to create the report's design first and simply fill it
>with data from the form. There are many ways to do this, but here's one of
>the simplest (air code):


Thanks for your reply, but I'm afraid I don't understand what to do.

--
Nigel M
 
Reply With Quote
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      2nd Mar 2006
1. "MyButton" is the name of your button. In the property sheet go to the
click event, drop down the arrow and choose [Event Procedure] The click on
the ellipses button (...)

2. "YourReport" is the name of the report you wan to run.

3. Me.txtIDField is the textbox with the ID of the record on the form.
Replace "txtIDField" with your textbox name.

4. "Your Update Query" is the name of the update query you wan to run.

All the other code needs to be cut and pasted EXACTLY like you see it.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

"Arvin Meyer [MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> The ideal method is to create the report's design first and simply fill it
> with data from the form. There are many ways to do this, but here's one of
> the simplest (air code):
>
> Sub MyButton_Click()
> On Error GoTo Error_Handler
> DoCmd.RunCommand acCmdSaveRecord
>
> DoCmd.OpenReport "YourReport",,,,"ID=" & Me.txtIDField
>
> DoCmd.SetWarnings False
> DoCmd.OpenQuery "Your Update Query"
>
> Exit_Here:
> DoCmd.SetWarnings True
> Exit Sub
> Error_Handler"
> MsgBox " Err.Number & ": " & Err.Description
> Resume Exit Here
> End Sub
>
> There are better ways of running the update query, but that one is the
> simplest.
> --
> Arvin Meyer, MCP, MVP
> Microsoft Access
> Free Access downloads
> http://www.datastrat.com
> http://www.mvps.org/access
>
> "Nigel Molesworth" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > I've got a data input from on my database. When I have input the data
> > (often a single item) I then:
> >
> > close the form
> > create a report
> > print the report (a label)
> > run an update query
> >
> > The update query (which asks me twice if I'm sure) is to remove a
> > "print me" flag and put the current date in the date field.
> >
> > This would be so much easier if I could do it all from the input form,
> > preferably from a single button, but at this stage I don't know if the
> > underlying table has been updated with the data.
> >
> > Even if I had to close the input form first, is it possible to
> > automate such tasks, as in a macro?
> >
> > --
> > Nigel M

>
>



 
Reply With Quote
 
=?Utf-8?B?Yl9idXNzb2xvdGk=?=
Guest
Posts: n/a
 
      13th Apr 2006
Marvin, you said that:
"There are better ways of running the update query, but that one is the
simplest."
Could you tell us what are these other ways, or maybe indicate a website
that contains such information?

"Arvin Meyer [MVP]" wrote:

> 1. "MyButton" is the name of your button. In the property sheet go to the
> click event, drop down the arrow and choose [Event Procedure] The click on
> the ellipses button (...)
>
> 2. "YourReport" is the name of the report you wan to run.
>
> 3. Me.txtIDField is the textbox with the ID of the record on the form.
> Replace "txtIDField" with your textbox name.
>
> 4. "Your Update Query" is the name of the update query you wan to run.
>
> All the other code needs to be cut and pasted EXACTLY like you see it.
> --
> Arvin Meyer, MCP, MVP
> Microsoft Access
> Free Access downloads
> http://www.datastrat.com
> http://www.mvps.org/access
>
> "Arvin Meyer [MVP]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > The ideal method is to create the report's design first and simply fill it
> > with data from the form. There are many ways to do this, but here's one of
> > the simplest (air code):
> >
> > Sub MyButton_Click()
> > On Error GoTo Error_Handler
> > DoCmd.RunCommand acCmdSaveRecord
> >
> > DoCmd.OpenReport "YourReport",,,,"ID=" & Me.txtIDField
> >
> > DoCmd.SetWarnings False
> > DoCmd.OpenQuery "Your Update Query"
> >
> > Exit_Here:
> > DoCmd.SetWarnings True
> > Exit Sub
> > Error_Handler"
> > MsgBox " Err.Number & ": " & Err.Description
> > Resume Exit Here
> > End Sub
> >
> > There are better ways of running the update query, but that one is the
> > simplest.
> > --
> > Arvin Meyer, MCP, MVP
> > Microsoft Access
> > Free Access downloads
> > http://www.datastrat.com
> > http://www.mvps.org/access
> >
> > "Nigel Molesworth" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > I've got a data input from on my database. When I have input the data
> > > (often a single item) I then:
> > >
> > > close the form
> > > create a report
> > > print the report (a label)
> > > run an update query
> > >
> > > The update query (which asks me twice if I'm sure) is to remove a
> > > "print me" flag and put the current date in the date field.
> > >
> > > This would be so much easier if I could do it all from the input form,
> > > preferably from a single button, but at this stage I don't know if the
> > > underlying table has been updated with the data.
> > >
> > > Even if I had to close the input form first, is it possible to
> > > automate such tasks, as in a macro?
> > >
> > > --
> > > Nigel M

> >
> >

>
>
>

 
Reply With Quote
 
Van T. Dinh
Guest
Posts: n/a
 
      14th Apr 2006
Check Access VB Help on the Execute method of the Database object (DAO) or
the Connection object (ADO).

BTW, Mr Meyer's first name is ARVIN, not Marvin.

--
HTH
Van T. Dinh
MVP (Access)



"b_bussoloti" <(E-Mail Removed)> wrote in message
news:FEA2EB36-9DC5-4755-B5F2-(E-Mail Removed)...
> Marvin, you said that:
> "There are better ways of running the update query, but that one is the
> simplest."
> Could you tell us what are these other ways, or maybe indicate a website
> that contains such information?
>
> "Arvin Meyer [MVP]" wrote:
>
>> 1. "MyButton" is the name of your button. In the property sheet go to the
>> click event, drop down the arrow and choose [Event Procedure] The click
>> on
>> the ellipses button (...)
>>
>> 2. "YourReport" is the name of the report you wan to run.
>>
>> 3. Me.txtIDField is the textbox with the ID of the record on the form.
>> Replace "txtIDField" with your textbox name.
>>
>> 4. "Your Update Query" is the name of the update query you wan to run.
>>
>> All the other code needs to be cut and pasted EXACTLY like you see it.
>> --
>> Arvin Meyer, MCP, MVP
>> Microsoft Access
>> Free Access downloads
>> http://www.datastrat.com
>> http://www.mvps.org/access
>>
>> "Arvin Meyer [MVP]" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > The ideal method is to create the report's design first and simply fill
>> > it
>> > with data from the form. There are many ways to do this, but here's one
>> > of
>> > the simplest (air code):
>> >
>> > Sub MyButton_Click()
>> > On Error GoTo Error_Handler
>> > DoCmd.RunCommand acCmdSaveRecord
>> >
>> > DoCmd.OpenReport "YourReport",,,,"ID=" & Me.txtIDField
>> >
>> > DoCmd.SetWarnings False
>> > DoCmd.OpenQuery "Your Update Query"
>> >
>> > Exit_Here:
>> > DoCmd.SetWarnings True
>> > Exit Sub
>> > Error_Handler"
>> > MsgBox " Err.Number & ": " & Err.Description
>> > Resume Exit Here
>> > End Sub
>> >
>> > There are better ways of running the update query, but that one is the
>> > simplest.
>> > --
>> > Arvin Meyer, MCP, MVP
>> > Microsoft Access
>> > Free Access downloads
>> > http://www.datastrat.com
>> > http://www.mvps.org/access
>> >
>> > "Nigel Molesworth" <(E-Mail Removed)> wrote in message
>> > news:(E-Mail Removed)...
>> > > I've got a data input from on my database. When I have input the data
>> > > (often a single item) I then:
>> > >
>> > > close the form
>> > > create a report
>> > > print the report (a label)
>> > > run an update query
>> > >
>> > > The update query (which asks me twice if I'm sure) is to remove a
>> > > "print me" flag and put the current date in the date field.
>> > >
>> > > This would be so much easier if I could do it all from the input
>> > > form,
>> > > preferably from a single button, but at this stage I don't know if
>> > > the
>> > > underlying table has been updated with the data.
>> > >
>> > > Even if I had to close the input form first, is it possible to
>> > > automate such tasks, as in a macro?
>> > >
>> > > --
>> > > Nigel M
>> >
>> >

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?Yl9idXNzb2xvdGk=?=
Guest
Posts: n/a
 
      17th Apr 2006
Many thanks for the help.... and sorry for the mispelling of Mr. Arvin Meyer
name.

"Van T. Dinh" wrote:

> Check Access VB Help on the Execute method of the Database object (DAO) or
> the Connection object (ADO).
>
> BTW, Mr Meyer's first name is ARVIN, not Marvin.
>
> --
> HTH
> Van T. Dinh
> MVP (Access)
>
>
>
> "b_bussoloti" <(E-Mail Removed)> wrote in message
> news:FEA2EB36-9DC5-4755-B5F2-(E-Mail Removed)...
> > Marvin, you said that:
> > "There are better ways of running the update query, but that one is the
> > simplest."
> > Could you tell us what are these other ways, or maybe indicate a website
> > that contains such information?
> >
> > "Arvin Meyer [MVP]" wrote:
> >
> >> 1. "MyButton" is the name of your button. In the property sheet go to the
> >> click event, drop down the arrow and choose [Event Procedure] The click
> >> on
> >> the ellipses button (...)
> >>
> >> 2. "YourReport" is the name of the report you wan to run.
> >>
> >> 3. Me.txtIDField is the textbox with the ID of the record on the form.
> >> Replace "txtIDField" with your textbox name.
> >>
> >> 4. "Your Update Query" is the name of the update query you wan to run.
> >>
> >> All the other code needs to be cut and pasted EXACTLY like you see it.
> >> --
> >> Arvin Meyer, MCP, MVP
> >> Microsoft Access
> >> Free Access downloads
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >>
> >> "Arvin Meyer [MVP]" <(E-Mail Removed)> wrote in message
> >> news:(E-Mail Removed)...
> >> > The ideal method is to create the report's design first and simply fill
> >> > it
> >> > with data from the form. There are many ways to do this, but here's one
> >> > of
> >> > the simplest (air code):
> >> >
> >> > Sub MyButton_Click()
> >> > On Error GoTo Error_Handler
> >> > DoCmd.RunCommand acCmdSaveRecord
> >> >
> >> > DoCmd.OpenReport "YourReport",,,,"ID=" & Me.txtIDField
> >> >
> >> > DoCmd.SetWarnings False
> >> > DoCmd.OpenQuery "Your Update Query"
> >> >
> >> > Exit_Here:
> >> > DoCmd.SetWarnings True
> >> > Exit Sub
> >> > Error_Handler"
> >> > MsgBox " Err.Number & ": " & Err.Description
> >> > Resume Exit Here
> >> > End Sub
> >> >
> >> > There are better ways of running the update query, but that one is the
> >> > simplest.
> >> > --
> >> > Arvin Meyer, MCP, MVP
> >> > Microsoft Access
> >> > Free Access downloads
> >> > http://www.datastrat.com
> >> > http://www.mvps.org/access
> >> >
> >> > "Nigel Molesworth" <(E-Mail Removed)> wrote in message
> >> > news:(E-Mail Removed)...
> >> > > I've got a data input from on my database. When I have input the data
> >> > > (often a single item) I then:
> >> > >
> >> > > close the form
> >> > > create a report
> >> > > print the report (a label)
> >> > > run an update query
> >> > >
> >> > > The update query (which asks me twice if I'm sure) is to remove a
> >> > > "print me" flag and put the current date in the date field.
> >> > >
> >> > > This would be so much easier if I could do it all from the input
> >> > > form,
> >> > > preferably from a single button, but at this stage I don't know if
> >> > > the
> >> > > underlying table has been updated with the data.
> >> > >
> >> > > Even if I had to close the input form first, is it possible to
> >> > > automate such tasks, as in a macro?
> >> > >
> >> > > --
> >> > > Nigel M
> >> >
> >> >
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: automate cut/insert tasks JE McGimpsey Microsoft Excel Programming 0 16th Jan 2007 11:20 PM
Automate tasks in Access Sharp Microsoft Access 1 11th Feb 2005 10:11 AM
Scheduled Tasks-Automate? Purchasing Microsoft Windows 2000 Applications 4 7th Oct 2004 03:59 PM
Automate tasks =?Utf-8?B?TURN?= Microsoft Word Document Management 1 3rd Feb 2004 02:44 PM
Automate tasks in XP Brian Windows XP Customization 3 19th Nov 2003 09:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:22 AM.