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  

Tracking Visits by Members



 
 
Thread Tools Display Modes
  #1  
Old June 9th, 2004, 10:40 PM
John R. Youngman
external usenet poster
 
Posts: n/a
Default Tracking Visits by Members

Hi. I have a membership database that will now be used to track member
visits to our location. When the member's record is displayed, I'd like to
have a button that I can click on which will add the time and date to their
record each time they visit. I think I need a separate table to store this
info. Any ideas?

TIA

John


  #2  
Old June 10th, 2004, 01:08 AM
John Vinson
external usenet poster
 
Posts: n/a
Default Tracking Visits by Members

On Wed, 9 Jun 2004 14:40:34 -0700, "John R. Youngman"
wrote:

Hi. I have a membership database that will now be used to track member
visits to our location. When the member's record is displayed, I'd like to
have a button that I can click on which will add the time and date to their
record each time they visit. I think I need a separate table to store this
info. Any ideas?


You do indeed need a second table, with fields for the MemberID, and
the date and time of the visit. You can set the Default property of
this field to Now() if you'll be entering the data at the time of the
visit; if you just display the visits table as a Subform of the member
form, you can simply add a new record and it will record the time
automatically.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
  #3  
Old June 10th, 2004, 04:01 AM
John R. Youngman
external usenet poster
 
Posts: n/a
Default Tracking Visits by Members

Thanks for your advise, John.

Is there a way to populate the fields in the second table by using a command
button on the form? If I'm displaying the member record, I'd like to have a
button the the user can click which will add an entry to the second table
for the time and date. The entry will be done at the time of the visit, so
the Now() part should work just fine.

Thanks again.

John



"John Vinson" wrote in message
...
On Wed, 9 Jun 2004 14:40:34 -0700, "John R. Youngman"
wrote:

Hi. I have a membership database that will now be used to track member
visits to our location. When the member's record is displayed, I'd like

to
have a button that I can click on which will add the time and date to

their
record each time they visit. I think I need a separate table to store

this
info. Any ideas?


You do indeed need a second table, with fields for the MemberID, and
the date and time of the visit. You can set the Default property of
this field to Now() if you'll be entering the data at the time of the
visit; if you just display the visits table as a Subform of the member
form, you can simply add a new record and it will record the time
automatically.

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public



  #4  
Old June 10th, 2004, 04:09 AM
John Vinson
external usenet poster
 
Posts: n/a
Default Tracking Visits by Members

On Wed, 9 Jun 2004 20:01:35 -0700, "John R. Youngman"
wrote:

Is there a way to populate the fields in the second table by using a command
button on the form? If I'm displaying the member record, I'd like to have a
button the the user can click which will add an entry to the second table
for the time and date. The entry will be done at the time of the visit, so
the Now() part should work just fine.


Sure. The button could simply run a one-row Append query:

Private Sub cmdVisit_Click()
Dim strSQL As String
strSQL = "INSERT INTO [Visits] (MemberID, VisitTime) Values (" _
& Me!MemberID & ", #" & Now() & "#")
DoCmd.RunSQL strSQL
End Sub


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
 




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 11:23 PM.


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