Connecting Tech Pros Worldwide Forums | Help | Site Map

inserting records for multiple times and days

Eric Bacon
Guest
 
Posts: n/a
#1: Nov 13 '05
I am trying to create a form for a patient diary. The form is set up so
that information is entered for morning, afternoon and evening for day 1
to 7. Ideally, I would like to set up the form almost like a spreadsheet
such that the user can navigate through the form without having to enter
the specific time info for each new record. I'm thinking that I should
set up some sort of nested loop that would run through morning,
afternoon and evening for day 1 to 7 and have that information entered
automatically for each new record, but I'm not sure how to pull this off.

Any suggestions/advice, including alternative strategies?

Thanks,

Eric

pietlinden@hotmail.com
Guest
 
Posts: n/a
#2: Nov 13 '05

re: inserting records for multiple times and days



Eric Bacon wrote:[color=blue]
> I am trying to create a form for a patient diary. The form is set up[/color]
so[color=blue]
> that information is entered for morning, afternoon and evening for[/color]
day 1[color=blue]
> to 7. Ideally, I would like to set up the form almost like a[/color]
spreadsheet[color=blue]
> such that the user can navigate through the form without having to[/color]
enter[color=blue]
> the specific time info for each new record. I'm thinking that I[/color]
should[color=blue]
> set up some sort of nested loop that would run through morning,
> afternoon and evening for day 1 to 7 and have that information[/color]
entered[color=blue]
> automatically for each new record, but I'm not sure how to pull this[/color]
off.[color=blue]
>
> Any suggestions/advice, including alternative strategies?
>
> Thanks,
>
> Eric[/color]

How do I put this delicately? how good are your coding skills?
Creating a loop that does this is a walk in the park. doing all this
in Outlook is even easier - no code required. The spreadsheet look.
You could grab the code from Developer's Handbook, but unless you know
a fair amount about Access, it'll go right over your head. (It did
when I tried that...)

for intcounter = 0 to 6
'Calc date
dtTemp=Dateadd("d",somedate,intcounter)
rs.Addnew
rs.fields("DateDue")=dtTemp
rs.fields("PatientID")=Me.patientID
rs.update
next intCounter

Hope that points you in the right direction....

Eric Bacon
Guest
 
Posts: n/a
#3: Nov 13 '05

re: inserting records for multiple times and days


That does point me in the right direction - thanks. As you have guessed,
I'm a novice Access user so even though I know what I want to do and
even have some idea how to accomplish it I don't always know the syntax.
I've been meaning to figure out recordsets for some time now and this
seems like a good enough place to start.

Cheers,

Eric

pietlinden@hotmail.com wrote:
[color=blue]
>
> How do I put this delicately? how good are your coding skills?
> Creating a loop that does this is a walk in the park. doing all this
> in Outlook is even easier - no code required. The spreadsheet look.
> You could grab the code from Developer's Handbook, but unless you know
> a fair amount about Access, it'll go right over your head. (It did
> when I tried that...)
>
> for intcounter = 0 to 6
> 'Calc date
> dtTemp=Dateadd("d",somedate,intcounter)
> rs.Addnew
> rs.fields("DateDue")=dtTemp
> rs.fields("PatientID")=Me.patientID
> rs.update
> next intCounter
>
> Hope that points you in the right direction....
>[/color]
Closed Thread


Similar Microsoft Access / VBA bytes