PC Review


Reply
Thread Tools Rate Thread

can i add a record automatically

 
 
=?Utf-8?B?cmljaGFyZCBoYXJyaXM=?=
Guest
Posts: n/a
 
      20th May 2007
Hi All,

i have a form which allows a user to select which documents they wish to
print for a client record.

what i would like to do is to have a table (tblDocsPrinted) to record the
date and the name of each document printed.

i could just assign a field to each document and have this autodate but the
same document may be printed more than once, so i would like to record this.

my suggested fields are

DocID
DocName
DocPrintDate
DocUser (will be collected from logged on user)

is there a way that access can auto populate the table for me with the
correct date.

thanks in advance

richard
 
Reply With Quote
 
 
 
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      20th May 2007
If you use a button on a form to print the report, the code might look like
this (air code):

Sub MyButton_Click
Dim db As DAO.Database
Dim rst As DAO.Recordset

Set db = CurrentDB
Set rst = db.OpenRecordset("tblMyData", dbOpenDynaset)

With rst
.AddNew
!DocID Me.txtDocID
!DocName = "rptMyData"
!DocPrintDate = Now
!DocUser = CurrentUser()
.Update
End With
DoCmd.OpenReport "rptMyData", acNormal, , "[ID]=" & Me![txtID]
End Sub

Change the names for your own report/form/control names. Current user is a
function of Access security, to get the Windows users look at the following
code:

http://www.mvps.org/access/api/api0008.htm
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"richard harris" <(E-Mail Removed)> wrote in message
news:85C7DE48-3EF8-4E0C-BC8C-(E-Mail Removed)...
> Hi All,
>
> i have a form which allows a user to select which documents they wish to
> print for a client record.
>
> what i would like to do is to have a table (tblDocsPrinted) to record the
> date and the name of each document printed.
>
> i could just assign a field to each document and have this autodate but
> the
> same document may be printed more than once, so i would like to record
> this.
>
> my suggested fields are
>
> DocID
> DocName
> DocPrintDate
> DocUser (will be collected from logged on user)
>
> is there a way that access can auto populate the table for me with the
> correct date.
>
> thanks in advance
>
> richard



 
Reply With Quote
 
=?Utf-8?B?cmljaGFyZCBoYXJyaXM=?=
Guest
Posts: n/a
 
      21st May 2007
Thanks Arvin,

works great.

regards

richard

"Arvin Meyer [MVP]" wrote:

> If you use a button on a form to print the report, the code might look like
> this (air code):
>
> Sub MyButton_Click
> Dim db As DAO.Database
> Dim rst As DAO.Recordset
>
> Set db = CurrentDB
> Set rst = db.OpenRecordset("tblMyData", dbOpenDynaset)
>
> With rst
> .AddNew
> !DocID Me.txtDocID
> !DocName = "rptMyData"
> !DocPrintDate = Now
> !DocUser = CurrentUser()
> .Update
> End With
> DoCmd.OpenReport "rptMyData", acNormal, , "[ID]=" & Me![txtID]
> End Sub
>
> Change the names for your own report/form/control names. Current user is a
> function of Access security, to get the Windows users look at the following
> code:
>
> http://www.mvps.org/access/api/api0008.htm
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "richard harris" <(E-Mail Removed)> wrote in message
> news:85C7DE48-3EF8-4E0C-BC8C-(E-Mail Removed)...
> > Hi All,
> >
> > i have a form which allows a user to select which documents they wish to
> > print for a client record.
> >
> > what i would like to do is to have a table (tblDocsPrinted) to record the
> > date and the name of each document printed.
> >
> > i could just assign a field to each document and have this autodate but
> > the
> > same document may be printed more than once, so i would like to record
> > this.
> >
> > my suggested fields are
> >
> > DocID
> > DocName
> > DocPrintDate
> > DocUser (will be collected from logged on user)
> >
> > is there a way that access can auto populate the table for me with the
> > correct date.
> >
> > thanks in advance
> >
> > richard

>
>
>

 
Reply With Quote
 
=?Utf-8?B?cmljaGFyZCBoYXJyaXM=?=
Guest
Posts: n/a
 
      21st May 2007
Hi Arvin,

a further thought, is there a way to get the document saved to a file
progmatically and then have the list of docs that we have creayed here to be
a hyperlink or similiar to the document, so the doc can be opened within the
programme.

currently the document is saved using Save As and then navigated to the
particular file for the client. if we could do the above then there would be
no need to save the doc to a particular file as the would be recalled through
the programme for each client.

ps - some docs are created using word and other using Access reports - i can
convert all to word if need be.

kind regards

richard

"Arvin Meyer [MVP]" wrote:

> If you use a button on a form to print the report, the code might look like
> this (air code):
>
> Sub MyButton_Click
> Dim db As DAO.Database
> Dim rst As DAO.Recordset
>
> Set db = CurrentDB
> Set rst = db.OpenRecordset("tblMyData", dbOpenDynaset)
>
> With rst
> .AddNew
> !DocID Me.txtDocID
> !DocName = "rptMyData"
> !DocPrintDate = Now
> !DocUser = CurrentUser()
> .Update
> End With
> DoCmd.OpenReport "rptMyData", acNormal, , "[ID]=" & Me![txtID]
> End Sub
>
> Change the names for your own report/form/control names. Current user is a
> function of Access security, to get the Windows users look at the following
> code:
>
> http://www.mvps.org/access/api/api0008.htm
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "richard harris" <(E-Mail Removed)> wrote in message
> news:85C7DE48-3EF8-4E0C-BC8C-(E-Mail Removed)...
> > Hi All,
> >
> > i have a form which allows a user to select which documents they wish to
> > print for a client record.
> >
> > what i would like to do is to have a table (tblDocsPrinted) to record the
> > date and the name of each document printed.
> >
> > i could just assign a field to each document and have this autodate but
> > the
> > same document may be printed more than once, so i would like to record
> > this.
> >
> > my suggested fields are
> >
> > DocID
> > DocName
> > DocPrintDate
> > DocUser (will be collected from logged on user)
> >
> > is there a way that access can auto populate the table for me with the
> > correct date.
> >
> > thanks in advance
> >
> > richard

>
>
>

 
Reply With Quote
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      22nd May 2007
For a demonstration of a similar technique to what you are describing, have
a look at my DocMgr demo database:

http://www.datastrat.com/Download/DocMgr_2K.zip
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"richard harris" <(E-Mail Removed)> wrote in message
news:526A96D2-8F24-402B-AC6B-(E-Mail Removed)...
> Hi Arvin,
>
> a further thought, is there a way to get the document saved to a file
> progmatically and then have the list of docs that we have creayed here to
> be
> a hyperlink or similiar to the document, so the doc can be opened within
> the
> programme.
>
> currently the document is saved using Save As and then navigated to the
> particular file for the client. if we could do the above then there would
> be
> no need to save the doc to a particular file as the would be recalled
> through
> the programme for each client.
>
> ps - some docs are created using word and other using Access reports - i
> can
> convert all to word if need be.
>
> kind regards
>
> richard
>
> "Arvin Meyer [MVP]" wrote:
>
>> If you use a button on a form to print the report, the code might look
>> like
>> this (air code):
>>
>> Sub MyButton_Click
>> Dim db As DAO.Database
>> Dim rst As DAO.Recordset
>>
>> Set db = CurrentDB
>> Set rst = db.OpenRecordset("tblMyData", dbOpenDynaset)
>>
>> With rst
>> .AddNew
>> !DocID Me.txtDocID
>> !DocName = "rptMyData"
>> !DocPrintDate = Now
>> !DocUser = CurrentUser()
>> .Update
>> End With
>> DoCmd.OpenReport "rptMyData", acNormal, , "[ID]=" & Me![txtID]
>> End Sub
>>
>> Change the names for your own report/form/control names. Current user is
>> a
>> function of Access security, to get the Windows users look at the
>> following
>> code:
>>
>> http://www.mvps.org/access/api/api0008.htm
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "richard harris" <(E-Mail Removed)> wrote in
>> message
>> news:85C7DE48-3EF8-4E0C-BC8C-(E-Mail Removed)...
>> > Hi All,
>> >
>> > i have a form which allows a user to select which documents they wish
>> > to
>> > print for a client record.
>> >
>> > what i would like to do is to have a table (tblDocsPrinted) to record
>> > the
>> > date and the name of each document printed.
>> >
>> > i could just assign a field to each document and have this autodate but
>> > the
>> > same document may be printed more than once, so i would like to record
>> > this.
>> >
>> > my suggested fields are
>> >
>> > DocID
>> > DocName
>> > DocPrintDate
>> > DocUser (will be collected from logged on user)
>> >
>> > is there a way that access can auto populate the table for me with the
>> > correct date.
>> >
>> > thanks in advance
>> >
>> > richard

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?cmljaGFyZCBoYXJyaXM=?=
Guest
Posts: n/a
 
      22nd May 2007
hi Arvin,

thanks, ill have a look tonights.

cheers

richard

"Arvin Meyer [MVP]" wrote:

> For a demonstration of a similar technique to what you are describing, have
> a look at my DocMgr demo database:
>
> http://www.datastrat.com/Download/DocMgr_2K.zip
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "richard harris" <(E-Mail Removed)> wrote in message
> news:526A96D2-8F24-402B-AC6B-(E-Mail Removed)...
> > Hi Arvin,
> >
> > a further thought, is there a way to get the document saved to a file
> > progmatically and then have the list of docs that we have creayed here to
> > be
> > a hyperlink or similiar to the document, so the doc can be opened within
> > the
> > programme.
> >
> > currently the document is saved using Save As and then navigated to the
> > particular file for the client. if we could do the above then there would
> > be
> > no need to save the doc to a particular file as the would be recalled
> > through
> > the programme for each client.
> >
> > ps - some docs are created using word and other using Access reports - i
> > can
> > convert all to word if need be.
> >
> > kind regards
> >
> > richard
> >
> > "Arvin Meyer [MVP]" wrote:
> >
> >> If you use a button on a form to print the report, the code might look
> >> like
> >> this (air code):
> >>
> >> Sub MyButton_Click
> >> Dim db As DAO.Database
> >> Dim rst As DAO.Recordset
> >>
> >> Set db = CurrentDB
> >> Set rst = db.OpenRecordset("tblMyData", dbOpenDynaset)
> >>
> >> With rst
> >> .AddNew
> >> !DocID Me.txtDocID
> >> !DocName = "rptMyData"
> >> !DocPrintDate = Now
> >> !DocUser = CurrentUser()
> >> .Update
> >> End With
> >> DoCmd.OpenReport "rptMyData", acNormal, , "[ID]=" & Me![txtID]
> >> End Sub
> >>
> >> Change the names for your own report/form/control names. Current user is
> >> a
> >> function of Access security, to get the Windows users look at the
> >> following
> >> code:
> >>
> >> http://www.mvps.org/access/api/api0008.htm
> >> --
> >> Arvin Meyer, MCP, MVP
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >> "richard harris" <(E-Mail Removed)> wrote in
> >> message
> >> news:85C7DE48-3EF8-4E0C-BC8C-(E-Mail Removed)...
> >> > Hi All,
> >> >
> >> > i have a form which allows a user to select which documents they wish
> >> > to
> >> > print for a client record.
> >> >
> >> > what i would like to do is to have a table (tblDocsPrinted) to record
> >> > the
> >> > date and the name of each document printed.
> >> >
> >> > i could just assign a field to each document and have this autodate but
> >> > the
> >> > same document may be printed more than once, so i would like to record
> >> > this.
> >> >
> >> > my suggested fields are
> >> >
> >> > DocID
> >> > DocName
> >> > DocPrintDate
> >> > DocUser (will be collected from logged on user)
> >> >
> >> > is there a way that access can auto populate the table for me with the
> >> > correct date.
> >> >
> >> > thanks in advance
> >> >
> >> > richard
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
=?Utf-8?B?cmljaGFyZCBoYXJyaXM=?=
Guest
Posts: n/a
 
      22nd May 2007
Hi Arvin,

i have had a look at the programme which seems to solve the issue i am
having, i have a couple of questions i hope you cananswer.

would the users still save their documents to the individual client file and
then this programme would pick them up at whichpint they could be opened n
the future from inside the programme to negate the need to explore folders?

would there be a way of having your programme refer to a particular client
(maybe a sub folder field from within the main folder) i hope that makes
sense. my thinking here, is when a record is opened for a particular client
could your programme recognise that (maybe through a filtered query)
particular record and as such only show documents relating to that client.

or, would a new table need to be created for each client and then the table
list filtered to reflect the particular client so it only shows the relavent
records.

i hope this is all clear, i like what you have done and hope it can be
implemented

thanks

richard

"Arvin Meyer [MVP]" wrote:

> For a demonstration of a similar technique to what you are describing, have
> a look at my DocMgr demo database:
>
> http://www.datastrat.com/Download/DocMgr_2K.zip
> --
> Arvin Meyer, MCP, MVP
> http://www.datastrat.com
> http://www.mvps.org/access
> http://www.accessmvp.com
>
> "richard harris" <(E-Mail Removed)> wrote in message
> news:526A96D2-8F24-402B-AC6B-(E-Mail Removed)...
> > Hi Arvin,
> >
> > a further thought, is there a way to get the document saved to a file
> > progmatically and then have the list of docs that we have creayed here to
> > be
> > a hyperlink or similiar to the document, so the doc can be opened within
> > the
> > programme.
> >
> > currently the document is saved using Save As and then navigated to the
> > particular file for the client. if we could do the above then there would
> > be
> > no need to save the doc to a particular file as the would be recalled
> > through
> > the programme for each client.
> >
> > ps - some docs are created using word and other using Access reports - i
> > can
> > convert all to word if need be.
> >
> > kind regards
> >
> > richard
> >
> > "Arvin Meyer [MVP]" wrote:
> >
> >> If you use a button on a form to print the report, the code might look
> >> like
> >> this (air code):
> >>
> >> Sub MyButton_Click
> >> Dim db As DAO.Database
> >> Dim rst As DAO.Recordset
> >>
> >> Set db = CurrentDB
> >> Set rst = db.OpenRecordset("tblMyData", dbOpenDynaset)
> >>
> >> With rst
> >> .AddNew
> >> !DocID Me.txtDocID
> >> !DocName = "rptMyData"
> >> !DocPrintDate = Now
> >> !DocUser = CurrentUser()
> >> .Update
> >> End With
> >> DoCmd.OpenReport "rptMyData", acNormal, , "[ID]=" & Me![txtID]
> >> End Sub
> >>
> >> Change the names for your own report/form/control names. Current user is
> >> a
> >> function of Access security, to get the Windows users look at the
> >> following
> >> code:
> >>
> >> http://www.mvps.org/access/api/api0008.htm
> >> --
> >> Arvin Meyer, MCP, MVP
> >> http://www.datastrat.com
> >> http://www.mvps.org/access
> >> http://www.accessmvp.com
> >>
> >> "richard harris" <(E-Mail Removed)> wrote in
> >> message
> >> news:85C7DE48-3EF8-4E0C-BC8C-(E-Mail Removed)...
> >> > Hi All,
> >> >
> >> > i have a form which allows a user to select which documents they wish
> >> > to
> >> > print for a client record.
> >> >
> >> > what i would like to do is to have a table (tblDocsPrinted) to record
> >> > the
> >> > date and the name of each document printed.
> >> >
> >> > i could just assign a field to each document and have this autodate but
> >> > the
> >> > same document may be printed more than once, so i would like to record
> >> > this.
> >> >
> >> > my suggested fields are
> >> >
> >> > DocID
> >> > DocName
> >> > DocPrintDate
> >> > DocUser (will be collected from logged on user)
> >> >
> >> > is there a way that access can auto populate the table for me with the
> >> > correct date.
> >> >
> >> > thanks in advance
> >> >
> >> > richard
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Arvin Meyer [MVP]
Guest
Posts: n/a
 
      25th May 2007
The code would have to be altered. I'd drill down to the client folder and
import the entire table for each folder each time. Then I'd compare and add
the new ones. If you didn't have to match records because of a key, you
could just reimport them each time.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com

"richard harris" <(E-Mail Removed)> wrote in message
news:65E9EA3E-6C7E-4B50-96A3-(E-Mail Removed)...
> Hi Arvin,
>
> i have had a look at the programme which seems to solve the issue i am
> having, i have a couple of questions i hope you cananswer.
>
> would the users still save their documents to the individual client file
> and
> then this programme would pick them up at whichpint they could be opened n
> the future from inside the programme to negate the need to explore
> folders?
>
> would there be a way of having your programme refer to a particular client
> (maybe a sub folder field from within the main folder) i hope that makes
> sense. my thinking here, is when a record is opened for a particular
> client
> could your programme recognise that (maybe through a filtered query)
> particular record and as such only show documents relating to that client.
>
> or, would a new table need to be created for each client and then the
> table
> list filtered to reflect the particular client so it only shows the
> relavent
> records.
>
> i hope this is all clear, i like what you have done and hope it can be
> implemented
>
> thanks
>
> richard
>
> "Arvin Meyer [MVP]" wrote:
>
>> For a demonstration of a similar technique to what you are describing,
>> have
>> a look at my DocMgr demo database:
>>
>> http://www.datastrat.com/Download/DocMgr_2K.zip
>> --
>> Arvin Meyer, MCP, MVP
>> http://www.datastrat.com
>> http://www.mvps.org/access
>> http://www.accessmvp.com
>>
>> "richard harris" <(E-Mail Removed)> wrote in
>> message
>> news:526A96D2-8F24-402B-AC6B-(E-Mail Removed)...
>> > Hi Arvin,
>> >
>> > a further thought, is there a way to get the document saved to a file
>> > progmatically and then have the list of docs that we have creayed here
>> > to
>> > be
>> > a hyperlink or similiar to the document, so the doc can be opened
>> > within
>> > the
>> > programme.
>> >
>> > currently the document is saved using Save As and then navigated to the
>> > particular file for the client. if we could do the above then there
>> > would
>> > be
>> > no need to save the doc to a particular file as the would be recalled
>> > through
>> > the programme for each client.
>> >
>> > ps - some docs are created using word and other using Access reports -
>> > i
>> > can
>> > convert all to word if need be.
>> >
>> > kind regards
>> >
>> > richard
>> >
>> > "Arvin Meyer [MVP]" wrote:
>> >
>> >> If you use a button on a form to print the report, the code might look
>> >> like
>> >> this (air code):
>> >>
>> >> Sub MyButton_Click
>> >> Dim db As DAO.Database
>> >> Dim rst As DAO.Recordset
>> >>
>> >> Set db = CurrentDB
>> >> Set rst = db.OpenRecordset("tblMyData", dbOpenDynaset)
>> >>
>> >> With rst
>> >> .AddNew
>> >> !DocID Me.txtDocID
>> >> !DocName = "rptMyData"
>> >> !DocPrintDate = Now
>> >> !DocUser = CurrentUser()
>> >> .Update
>> >> End With
>> >> DoCmd.OpenReport "rptMyData", acNormal, , "[ID]=" & Me![txtID]
>> >> End Sub
>> >>
>> >> Change the names for your own report/form/control names. Current user
>> >> is
>> >> a
>> >> function of Access security, to get the Windows users look at the
>> >> following
>> >> code:
>> >>
>> >> http://www.mvps.org/access/api/api0008.htm
>> >> --
>> >> Arvin Meyer, MCP, MVP
>> >> http://www.datastrat.com
>> >> http://www.mvps.org/access
>> >> http://www.accessmvp.com
>> >>
>> >> "richard harris" <(E-Mail Removed)> wrote in
>> >> message
>> >> news:85C7DE48-3EF8-4E0C-BC8C-(E-Mail Removed)...
>> >> > Hi All,
>> >> >
>> >> > i have a form which allows a user to select which documents they
>> >> > wish
>> >> > to
>> >> > print for a client record.
>> >> >
>> >> > what i would like to do is to have a table (tblDocsPrinted) to
>> >> > record
>> >> > the
>> >> > date and the name of each document printed.
>> >> >
>> >> > i could just assign a field to each document and have this autodate
>> >> > but
>> >> > the
>> >> > same document may be printed more than once, so i would like to
>> >> > record
>> >> > this.
>> >> >
>> >> > my suggested fields are
>> >> >
>> >> > DocID
>> >> > DocName
>> >> > DocPrintDate
>> >> > DocUser (will be collected from logged on user)
>> >> >
>> >> > is there a way that access can auto populate the table for me with
>> >> > the
>> >> > correct date.
>> >> >
>> >> > thanks in advance
>> >> >
>> >> > richard
>> >>
>> >>
>> >>

>>
>>
>>



 
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
Error when press "Save Record" but not when record saves itself automatically AndyCotgreave Microsoft Access 3 26th Jan 2006 02:08 PM
Automatically fill record with data from previous record =?Utf-8?B?TU9TRTE=?= Microsoft Access 1 23rd Jun 2005 10:26 PM
Automatically record date/time record is updated =?Utf-8?B?RG9ubmE=?= Microsoft Access 6 4th Jun 2005 12:25 PM
Fill record with Data from Previous Record Automatically - Knowledge Base Articl Michael Doyle Microsoft Access Forms 1 30th Oct 2003 03:04 PM
Fill Record with Data from Previous Record Automatically Marie Microsoft Access Forms 3 23rd Sep 2003 06:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:12 PM.