PC Review
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Automatically fetch data from table
Forums
Newsgroups
Microsoft Access
Microsoft Access VBA Modules
Automatically fetch data from table
![]() |
Automatically fetch data from table |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I have 2 tables Emp_Name & Muster. For every single day i need to pick all
the entries in EMp_name. Is there any way to program it, so that I dont need to copy and paste it every time |
|
|
|
#2 |
|
Guest
Posts: n/a
|
If you want to create records in Muster for a specific date, then you might
use an append query. INSERT INTO Muster (EmpID, MusterDate) SELECT EmpId, Date() as Today FROM Emp_Name Or you can use a query as the source. You need to give a bit more detail as to the structure of your tables. I am guessing that you have an EmpID field in both tables and a MusterDate field. You can construct a query based on the two tables that will show EmpID and a blank field for the musterdate. John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County manolakshman wrote: > I have 2 tables Emp_Name & Muster. For every single day i need to pick all > the entries in EMp_name. Is there any way to program it, so that I dont need > to copy and paste it every time |
|
|
|
#3 |
|
Guest
Posts: n/a
|
Hey this is in continuation with my earlier post, in a similar way can date
entries in a muster roll can also be done automatically for a particular month. For example when I give a month (say:JULY'09) as input can a query select all the name from the 'Emp_Name' table and fill it in a 'muster roll' table. "John Spencer" wrote: > If you want to create records in Muster for a specific date, then you might > use an append query. > > INSERT INTO Muster (EmpID, MusterDate) > SELECT EmpId, Date() as Today > FROM Emp_Name > > Or you can use a query as the source. You need to give a bit more detail as > to the structure of your tables. I am guessing that you have an EmpID field > in both tables and a MusterDate field. You can construct a query based on the > two tables that will show EmpID and a blank field for the musterdate. > > John Spencer > Access MVP 2002-2005, 2007-2009 > The Hilltop Institute > University of Maryland Baltimore County > > manolakshman wrote: > > I have 2 tables Emp_Name & Muster. For every single day i need to pick all > > the entries in EMp_name. Is there any way to program it, so that I dont need > > to copy and paste it every time > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
If you wish to do so, yes. You would need an auxilary table (tblNumbers) with
one field (TheNumber) contains numbers from 1 to at least 31. Then you could use something like the following. You would enter any date in the month you were interested in. INSERT INTO Muster (EmpID, MusterDate) SELECT EmpId , DateAdd("d",[tblNumbers].[TheNumber]-1,[Enter Start Date]) as Today FROM Emp_Name , tblNumbers WHERE [tblNumbers].[TheNumber] Between 1 and Day(DateSerial(Year([Enter Start Date]),Month([Enter Start Date])+1,0)) John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County John Spencer wrote: > If you want to create records in Muster for a specific date, then you > might use an append query. > > INSERT INTO Muster (EmpID, MusterDate) > SELECT EmpId, Date() as Today > FROM Emp_Name > > Or you can use a query as the source. You need to give a bit more > detail as to the structure of your tables. I am guessing that you have > an EmpID field in both tables and a MusterDate field. You can construct > a query based on the two tables that will show EmpID and a blank field > for the musterdate. > > John Spencer > Access MVP 2002-2005, 2007-2009 > The Hilltop Institute > University of Maryland Baltimore County > > manolakshman wrote: >> I have 2 tables Emp_Name & Muster. For every single day i need to pick >> all the entries in EMp_name. Is there any way to program it, so that I >> dont need to copy and paste it every time |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

