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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |