Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-12-2008, 02:41 AM
=?Utf-8?B?U2VjcmV0IFNxdWlycmVs?=
 
Posts: n/a
Creating Multiple Records

I have a table with the following fields in it:

VacID
VacDate
EmpName
Hours

What I'm looking to do it create a form that I use to enter this info into.
The table is used to track vacation days by employee. But there needs to be a
new record for each vacation day an employee takes. The problem is I want my
users to be able to enter a date range of vacation days and have it create
new records for each day. For example if an employee takes 08/25/08 thru
08/29/08 I want a new record created for each day for that employee. I could
have the users create a new record for each day but that seems a bit tedious.
I want them to be able to enter a starting date, and ending date and then
have records created for each day including the starting and ending dates.
Can this be done?
Reply With Quote
  #2 (permalink)  
Old 08-12-2008, 02:47 AM
Larry Linson
 
Posts: n/a
Re: Creating Multiple Records

Yes, you can add the Records using either VBA DAO (or, ugh, ADO) code which
may add new Records or may execute a Query that adds the new Records. But,
there's not a built-in Form feature to do what you want, if that's what you
meant.

I don't do Macros, except on very rare occasions, an AutoKeys Macro, but
there's some possibility that you might be able to use a Macro to execute a
Query to do this.

Larry Linson
Microsoft Office Access MVP

"Secret Squirrel" <secretsquirrel@discussions.microsoft.com> wrote in
message news:A2C83551-0C09-40EE-8928-50320614DE06@microsoft.com...
>I have a table with the following fields in it:
>
> VacID
> VacDate
> EmpName
> Hours
>
> What I'm looking to do it create a form that I use to enter this info
> into.
> The table is used to track vacation days by employee. But there needs to
> be a
> new record for each vacation day an employee takes. The problem is I want
> my
> users to be able to enter a date range of vacation days and have it create
> new records for each day. For example if an employee takes 08/25/08 thru
> 08/29/08 I want a new record created for each day for that employee. I
> could
> have the users create a new record for each day but that seems a bit
> tedious.
> I want them to be able to enter a starting date, and ending date and then
> have records created for each day including the starting and ending dates.
> Can this be done?



Reply With Quote
  #3 (permalink)  
Old 08-12-2008, 02:55 AM
=?Utf-8?B?U2VjcmV0IFNxdWlycmVs?=
 
Posts: n/a
Re: Creating Multiple Records

That's what I meant. I can run it through a form but have the query execute
it. How would I start this process using DAO? Can you possibly point me in
the direction I should start from?

"Larry Linson" wrote:

> Yes, you can add the Records using either VBA DAO (or, ugh, ADO) code which
> may add new Records or may execute a Query that adds the new Records. But,
> there's not a built-in Form feature to do what you want, if that's what you
> meant.
>
> I don't do Macros, except on very rare occasions, an AutoKeys Macro, but
> there's some possibility that you might be able to use a Macro to execute a
> Query to do this.
>
> Larry Linson
> Microsoft Office Access MVP
>
> "Secret Squirrel" <secretsquirrel@discussions.microsoft.com> wrote in
> message news:A2C83551-0C09-40EE-8928-50320614DE06@microsoft.com...
> >I have a table with the following fields in it:
> >
> > VacID
> > VacDate
> > EmpName
> > Hours
> >
> > What I'm looking to do it create a form that I use to enter this info
> > into.
> > The table is used to track vacation days by employee. But there needs to
> > be a
> > new record for each vacation day an employee takes. The problem is I want
> > my
> > users to be able to enter a date range of vacation days and have it create
> > new records for each day. For example if an employee takes 08/25/08 thru
> > 08/29/08 I want a new record created for each day for that employee. I
> > could
> > have the users create a new record for each day but that seems a bit
> > tedious.
> > I want them to be able to enter a starting date, and ending date and then
> > have records created for each day including the starting and ending dates.
> > Can this be done?

>
>
>

Reply With Quote
  #4 (permalink)  
Old 08-12-2008, 04:05 AM
a a r o n _ k e m p f
 
Posts: n/a
Re: Creating Multiple Records

nothing wrong with ADO.
Adobe / MacroMedia have been using ADO for the past decade.

I can name a half dozen 10,000 + employee companies in Seattle.. where
I've build ADO applications that work just perfectly; thanks

-Aaron



On Aug 11, 6:47*pm, "Larry Linson" <boun...@localhost.not> wrote:
> Yes, you can add the Records using either VBA DAO (or, ugh, ADO) code which
> may add new Records or may execute a Query that adds the new Records. *But,
> there's not a built-in Form feature to do what you want, if that's what you
> meant.
>
> I don't do Macros, except on very rare occasions, an AutoKeys Macro, but
> there's some possibility that you might be able to use a Macro to executea
> Query to do this.
>
> *Larry Linson
> *Microsoft Office Access MVP
>
> "Secret Squirrel" <secretsquir...@discussions.microsoft.com> wrote in
> messagenews:A2C83551-0C09-40EE-8928-50320614DE06@microsoft.com...
>
> >I have a table with the following fields in it:

>
> > VacID
> > VacDate
> > EmpName
> > Hours

>
> > What I'm looking to do it create a form that I use to enter this info
> > into.
> > The table is used to track vacation days by employee. But there needs to
> > be a
> > new record for each vacation day an employee takes. The problem is I want
> > my
> > users to be able to enter a date range of vacation days and have it create
> > new records for each day. For example if an employee takes 08/25/08 thru
> > 08/29/08 I want a new record created for each day for that employee. I
> > could
> > have the users create a new record for each day but that seems a bit
> > tedious.
> > I want them to be able to enter a starting date, and ending date and then
> > have records created for each day including the starting and ending dates.
> > Can this be done?


Reply With Quote
  #5 (permalink)  
Old 08-12-2008, 05:07 AM
pietlinden@hotmail.com
 
Posts: n/a
Re: Creating Multiple Records

On Aug 11, 8:41*pm, Secret Squirrel
<secretsquir...@discussions.microsoft.com> wrote:
> I have a table with the following fields in it:
>
> VacID
> VacDate
> EmpName
> Hours
>
> What I'm looking to do it create a form that I use to enter this info into.
> The table is used to track vacation days by employee. But there needs to be a
> new record for each vacation day an employee takes. The problem is I wantmy
> users to be able to enter a date range of vacation days and have it create
> new records for each day. For example if an employee takes 08/25/08 thru
> 08/29/08 I want a new record created for each day for that employee. I could
> have the users create a new record for each day but that seems a bit tedious.
> I want them to be able to enter a starting date, and ending date and then
> have records created for each day including the starting and ending dates..
> Can this be done?


You would need two unbound text fields formatted as Date, say
txtVacStart and txtVacEnd Then you would add a button to your form
and ahve it do something like this...
Private Sub cmdAddVacationDays_Click()
Dim dtVacDay As Date
Dim rs As DAO.Recordset

Set rs = DBEngine(0)(0).OpenRecordset("VacationDays", dbOpenTable,
dbAppendOnly)

For dtVacDay = Me.txtVacStart To Me.txtVacEnd
rs.AddNew
rs.Fields("EmployeeID") = Me.cboEmployeeID
rs.Fields("VacationDay") = dtVacDay
rs.Update
Next dtVacDay

rs.Close
Set rs = Nothing

End Sub

Reply With Quote
  #6 (permalink)  
Old 08-12-2008, 06:05 AM
=?Utf-8?B?cG9zdGVkX2J5X2Fub255bW91cw==?=
 
Posts: n/a
Re: Creating Multiple Records

"a a r o n _ k e m p f" wrote:

> nothing wrong with ADO.


It's been superseded by ADO.NET which is something else different. It's just
kept around for backward compatibility because it was hyped so much by
marketing that it lured a few people into using it. Some, like aaron the
troll, became true believers for whom it did not have to be better to become
their obsession. It's obsolete but a few in Microsoft development are
pretending it's only obsolescent and nursing it along until they can move
everyone to ACE.

> Adobe / MacroMedia have been using ADO for the past decade.


ADO.NET has been out, replacing classic ADO where things count at Microsoft,
the DotNet world, for _nearly_ a decade. You must think the word decade has a
nice ring to it because you keep using it where it clearly is not true.

> I can name a half dozen 10,000 + employee
> companies in Seattle..


You can? What a pleasant surprise that you have that much intelligence.

> where I've build ADO applications that work
> just perfectly; thanks


Given the quality of your advice and postings here, it's hard to imagine
that you have done even one application of any kind that work even
marginally, much less "perfectly". It's not hard to imagine that you have
such a swellled head that your imagination would reshape anything you did to
your view of "perfect".

Buh-bye, cutie pie,

Anony Mous
Reply With Quote
  #7 (permalink)  
Old 08-12-2008, 02:34 PM
=?Utf-8?B?U2VjcmV0IFNxdWlycmVs?=
 
Posts: n/a
Re: Creating Multiple Records

Thanks for your help! Question: If I leave the end date control blank will it
just add a record for the date in the start date control? Also, how do I
avoid it adding weekends?

"pietlinden@hotmail.com" wrote:

> On Aug 11, 8:41 pm, Secret Squirrel
> <secretsquir...@discussions.microsoft.com> wrote:
> > I have a table with the following fields in it:
> >
> > VacID
> > VacDate
> > EmpName
> > Hours
> >
> > What I'm looking to do it create a form that I use to enter this info into.
> > The table is used to track vacation days by employee. But there needs to be a
> > new record for each vacation day an employee takes. The problem is I want my
> > users to be able to enter a date range of vacation days and have it create
> > new records for each day. For example if an employee takes 08/25/08 thru
> > 08/29/08 I want a new record created for each day for that employee. I could
> > have the users create a new record for each day but that seems a bit tedious.
> > I want them to be able to enter a starting date, and ending date and then
> > have records created for each day including the starting and ending dates..
> > Can this be done?

>
> You would need two unbound text fields formatted as Date, say
> txtVacStart and txtVacEnd Then you would add a button to your form
> and ahve it do something like this...
> Private Sub cmdAddVacationDays_Click()
> Dim dtVacDay As Date
> Dim rs As DAO.Recordset
>
> Set rs = DBEngine(0)(0).OpenRecordset("VacationDays", dbOpenTable,
> dbAppendOnly)
>
> For dtVacDay = Me.txtVacStart To Me.txtVacEnd
> rs.AddNew
> rs.Fields("EmployeeID") = Me.cboEmployeeID
> rs.Fields("VacationDay") = dtVacDay
> rs.Update
> Next dtVacDay
>
> rs.Close
> Set rs = Nothing
>
> End Sub
>
>

Reply With Quote
  #8 (permalink)  
Old 08-13-2008, 02:55 PM
George Hepworth
 
Posts: n/a
Re: Creating Multiple Records

IMHO, the best way to deal with trolls is a two-part strategy.

1. Ignore their standard rantings.
2. Step in when it is necessary to correct a misstatement that could
potentially mislead a novice poster.

While it is true that novice posters don't know a great deal about Access,
it is also true that most of them are smart enough to figure out quite
quickly who the trolls are.

"posted_by_anonymous" <postedbyanonymous@discussions.microsoft.com> wrote in
message news:BE4A571D-AB99-4052-941D-317E0B5D6AD8@microsoft.com...
> "a a r o n _ k e m p f" wrote:
>
> > nothing wrong with ADO.

>
> It's been superseded by ADO.NET which is something else different. It's
> just
> kept around for backward compatibility because it was hyped so much by
> marketing that it lured a few people into using it. Some, like aaron the
> troll, became true believers for whom it did not have to be better to
> become
> their obsession. It's obsolete but a few in Microsoft development are
> pretending it's only obsolescent and nursing it along until they can move
> everyone to ACE.
>
> > Adobe / MacroMedia have been using ADO for the past decade.

>
> ADO.NET has been out, replacing classic ADO where things count at
> Microsoft,
> the DotNet world, for _nearly_ a decade. You must think the word decade
> has a
> nice ring to it because you keep using it where it clearly is not true.
>
> > I can name a half dozen 10,000 + employee
> > companies in Seattle..

>
> You can? What a pleasant surprise that you have that much intelligence.
>
> > where I've build ADO applications that work
> > just perfectly; thanks

>
> Given the quality of your advice and postings here, it's hard to imagine
> that you have done even one application of any kind that work even
> marginally, much less "perfectly". It's not hard to imagine that you have
> such a swellled head that your imagination would reshape anything you did
> to
> your view of "perfect".
>
> Buh-bye, cutie pie,
>
> Anony Mous



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Access


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:02 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
| | | |



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114