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  

calculating multiple dates



 
 
Thread Tools Display Modes
  #1  
Old February 21st, 2006, 09:28 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default calculating multiple dates

I am currently in the process of developing a database that will keep track
of appointments that patients will have in the future. 2 tables; Demographics
and Visits. The visit table will hold future visits patients have. What I am
needing, I am wanting to populate multiple visit records with a calculation
button from a subform. Example, enter patient demographics then based on a
start date, click a calucate weekly appts and the subform will be populated
with the days the patient needs to come in for the next 12 weeks. Is this
even possible. I am stumped.
Thanks for any help.
  #2  
Old February 22nd, 2006, 12:43 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default calculating multiple dates

Amy,

You'll need code to do this. Maybe something like so:

Private Sub cmdSomeButton()
Dim db As Database
Dim strSQL As String
Dim intCtr As Integer
Dim dteVisitDate As Date

Set db = CurrentDb
dteVisitDate = Me!txtVisitDate

For intCtr = 1 To 12
dteVisitDate = DateAdd("ww", 1, dteVisitDate)

strSQL = "INSERT INTO tblMyTable (" & _
"PatientID, " & _
"VisitDate) " & _
"VALUES (" & _
Me!txtPatientID & "," & _
CDbl(dteVisitDate) & ")"

db.Execute strSQL, dbFailOnError
Next intCtr

Set db = Nothing
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
---------------------------

"amy14775" wrote in message
...
I am currently in the process of developing a database that will keep track
of appointments that patients will have in the future. 2 tables;
Demographics
and Visits. The visit table will hold future visits patients have. What I
am
needing, I am wanting to populate multiple visit records with a
calculation
button from a subform. Example, enter patient demographics then based on a
start date, click a calucate weekly appts and the subform will be
populated
with the days the patient needs to come in for the next 12 weeks. Is this
even possible. I am stumped.
Thanks for any help.



  #3  
Old February 22nd, 2006, 02:27 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default calculating multiple dates

Thank you so much. I figured I would need to code it but for some reason the
brain would not respond..Thanks it helped a lot.

"Graham R Seach" wrote:

Amy,

You'll need code to do this. Maybe something like so:

Private Sub cmdSomeButton()
Dim db As Database
Dim strSQL As String
Dim intCtr As Integer
Dim dteVisitDate As Date

Set db = CurrentDb
dteVisitDate = Me!txtVisitDate

For intCtr = 1 To 12
dteVisitDate = DateAdd("ww", 1, dteVisitDate)

strSQL = "INSERT INTO tblMyTable (" & _
"PatientID, " & _
"VisitDate) " & _
"VALUES (" & _
Me!txtPatientID & "," & _
CDbl(dteVisitDate) & ")"

db.Execute strSQL, dbFailOnError
Next intCtr

Set db = Nothing
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Canberra, Australia
---------------------------

"amy14775" wrote in message
...
I am currently in the process of developing a database that will keep track
of appointments that patients will have in the future. 2 tables;
Demographics
and Visits. The visit table will hold future visits patients have. What I
am
needing, I am wanting to populate multiple visit records with a
calculation
button from a subform. Example, enter patient demographics then based on a
start date, click a calucate weekly appts and the subform will be
populated
with the days the patient needs to come in for the next 12 weeks. Is this
even possible. I am stumped.
Thanks for any help.




 




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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif on multiple dates Jim Worksheet Functions 6 December 13th, 2005 05:56 PM
Calculating an Activities During Periods Of Natural Months and/or Dates Rayco Worksheet Functions 1 October 10th, 2005 01:30 PM
calculating the amounts between dates Moosh Running & Setting Up Queries 6 August 26th, 2005 07:23 PM
Calculating Due Dates Ajit Worksheet Functions 1 June 10th, 2004 07:24 AM
Calculating days between two dates and multiply them with different numbers [email protected] Worksheet Functions 3 June 1st, 2004 06:36 PM


All times are GMT +1. The time now is 05:59 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.