Calendar Form

M

Melissa

Hi

I am creating a database for a security company.

I have a form for "Company" 's , "Employees" , and "Contracts
On my Company Form, I have a subform for the contract, which works fine
My Employees form is just where you add employee info, this is also ok.

Now what I would like to do, is create a form with a large calendar on it,
and there must be a combo box perhaps on the top of the form to select which
Company the calendar belongs to. Then, after selecting a company from the
combo box, the user can double click on a day in a specific month which then
brings up an input box to type in the names of the security gaurds
(employees) who are working, or who have worked at that company's premises
on that specific day.

I would also like to be able to print this calendar form to see exaclty who
worked on which days. Would this report perhaps also be able to give a
total number of shifts worked per gaurd (employee)?

I found a database example on the internet of a similar "Calendar form"
which works great, However I cannot import the form and table into my
database - it wont work. The code for this form is also much more advanced
than my knowledge, so Im not sure exactly how to get it to work in my
database?

Please could someone assist me?

Thank you kindly

Melissa
 
M

Melissa

Boyd

Thank you very much for your reply

I have imported the module as well, and when i open the calendar form, it
gives me the "debug" option:

Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim db As DAO.Database
**Dim rs As DAO.Recordset
Dim i As Integer
Dim myDate As Date

(When - debug, line with stars next to it is highlited in yellow?)

Thank you

Melissa
 
D

Douglas J. Steele

What error do you get?

The fact that the previous line (Dim db As DAO.Database) doesn't cause
problems implies that the DAO library is properly referenced.
 
M

Melissa

Hi

Error: Compile Error....User defined type not defined.
(Dim db As DAO.Database) is also highlighted, each time I close and go back
in it highlites a different line.

What is the DAO library?

Thank you

Melissa
 
D

Douglas J. Steele

Go into the Refererences dialog (If you're using Access 2003 or earlier,
it'll be under the Tools menu when you're in the VB Editor, afraid I can't
remember where on the ribbon it is if you're using Access 2007, but you
need to be in the VB Editor there too)

Assuming you're using an MDB, you need to find the reference for Microsoft
DAO 3.6 Object Library and select it. If you're using an ACCDB, you need to
find the reference for Microsoft Office 12.0 Access database engine and
select it.
 
M

Melissa

I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as print
the various reports.

Is there perhaps a way that I can insert a combo box on my calendar form for
"CompanyName", in which I can select a company from the list, and then
add/view information on the calendar for that specific company?

Eg. I select "ABC Trading", and then add some text in the block for January
15th, then I select a differenct company "SEL Importers" from the list, and
the text i inserted on January 15th for ABC traders will no longer
appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa
 
D

Douglas J. Steele

Base the form on a query. As a criteria in the query (under the CompanyName
field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the form:
Me.Requery
 
M

Melissa

Thank you for the reply

I put the record source of the form to "qryCalendar", which I have the field
"CompanyName", and then in the criteria, i added
Forms![frmCalendar]![CompanyName]

Also - after update for combo - Me.Requery

It still shows all the records for all the companies? did I perhaps do it
incorrectly? should more fields be added to the calendar query?

Thank you

Melissa
Douglas J. Steele said:
Base the form on a query. As a criteria in the query (under the
CompanyName field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the form:
Me.Requery

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as
print the various reports.

Is there perhaps a way that I can insert a combo box on my calendar form
for "CompanyName", in which I can select a company from the list, and
then add/view information on the calendar for that specific company?

Eg. I select "ABC Trading", and then add some text in the block for
January 15th, then I select a differenct company "SEL Importers" from the
list, and the text i inserted on January 15th for ABC traders will no
longer appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa
 
W

Warren

Try typing Me.Nameofyourform.Requery

Melissa said:
Thank you for the reply

I put the record source of the form to "qryCalendar", which I have the field
"CompanyName", and then in the criteria, i added
Forms![frmCalendar]![CompanyName]

Also - after update for combo - Me.Requery

It still shows all the records for all the companies? did I perhaps do it
incorrectly? should more fields be added to the calendar query?

Thank you

Melissa
Douglas J. Steele said:
Base the form on a query. As a criteria in the query (under the
CompanyName field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the form:
Me.Requery

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as
print the various reports.

Is there perhaps a way that I can insert a combo box on my calendar form
for "CompanyName", in which I can select a company from the list, and
then add/view information on the calendar for that specific company?

Eg. I select "ABC Trading", and then add some text in the block for
January 15th, then I select a differenct company "SEL Importers" from the
list, and the text i inserted on January 15th for ABC traders will no
longer appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa


Go into the Refererences dialog (If you're using Access 2003 or earlier,
it'll be under the Tools menu when you're in the VB Editor, afraid I
can't remember where on the ribbon it is if you're using Access 2007,
but you need to be in the VB Editor there too)

Assuming you're using an MDB, you need to find the reference for
Microsoft DAO 3.6 Object Library and select it. If you're using an
ACCDB, you need to find the reference for Microsoft Office 12.0 Access
database engine and select it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi

Error: Compile Error....User defined type not defined.
(Dim db As DAO.Database) is also highlighted, each time I close and go
back in it highlites a different line.

What is the DAO library?

Thank you

Melissa

What error do you get?

The fact that the previous line (Dim db As DAO.Database) doesn't cause
problems implies that the DAO library is properly referenced.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Boyd

Thank you very much for your reply

I have imported the module as well, and when i open the calendar
form, it gives me the "debug" option:

Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim db As DAO.Database
**Dim rs As DAO.Recordset
Dim i As Integer
Dim myDate As Date

(When - debug, line with stars next to it is highlited in yellow?)

Thank you

Melissa


"Boyd Trimmell aka HiTechCoach via AccessMonster.com" <u14500@uwe>
wrote in message Melissa wrote:
Hi

I am creating a database for a security company.

I have a form for "Company" 's , "Employees" , and "Contracts
On my Company Form, I have a subform for the contract, which works
fine
My Employees form is just where you add employee info, this is also
ok.

Now what I would like to do, is create a form with a large calendar
on it,
and there must be a combo box perhaps on the top of the form to
select which
Company the calendar belongs to. Then, after selecting a company
from the
combo box, the user can double click on a day in a specific month
which then
brings up an input box to type in the names of the security gaurds
(employees) who are working, or who have worked at that company's
premises
on that specific day.

I would also like to be able to print this calendar form to see
exaclty who
worked on which days. Would this report perhaps also be able to
give a
total number of shifts worked per gaurd (employee)?

I found a database example on the internet of a similar "Calendar
form"
which works great, However I cannot import the form and table into
my
database - it wont work. The code for this form is also much more
advanced
than my knowledge, so Im not sure exactly how to get it to work in
my
database?

Please could someone assist me?

Thank you kindly

Melissa


Did you check to see if there were any code "modules" that you also
need to
import? If there are any in the sample database, try importing
those also.
This may get the example to work in your database.

Hope this helps ....

--
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com

Message posted via AccessMonster.com
 
M

Melissa

Warren

I typed Me.frmCalendar.Requery

It says :Compile error, Method or data member not found, and it highlights
"frmCalendar" in the Me.frmCalendar.Requery line. ?

Thank you

Melissa

Warren said:
Try typing Me.Nameofyourform.Requery

Melissa said:
Thank you for the reply

I put the record source of the form to "qryCalendar", which I have the
field
"CompanyName", and then in the criteria, i added
Forms![frmCalendar]![CompanyName]

Also - after update for combo - Me.Requery

It still shows all the records for all the companies? did I perhaps do it
incorrectly? should more fields be added to the calendar query?

Thank you

Melissa
Douglas J. Steele said:
Base the form on a query. As a criteria in the query (under the
CompanyName field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the
form:
Me.Requery

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as
print the various reports.

Is there perhaps a way that I can insert a combo box on my calendar
form
for "CompanyName", in which I can select a company from the list, and
then add/view information on the calendar for that specific company?

Eg. I select "ABC Trading", and then add some text in the block for
January 15th, then I select a differenct company "SEL Importers" from
the
list, and the text i inserted on January 15th for ABC traders will no
longer appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa


message
Go into the Refererences dialog (If you're using Access 2003 or
earlier,
it'll be under the Tools menu when you're in the VB Editor, afraid I
can't remember where on the ribbon it is if you're using Access
2007,
but you need to be in the VB Editor there too)

Assuming you're using an MDB, you need to find the reference for
Microsoft DAO 3.6 Object Library and select it. If you're using an
ACCDB, you need to find the reference for Microsoft Office 12.0
Access
database engine and select it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi

Error: Compile Error....User defined type not defined.
(Dim db As DAO.Database) is also highlighted, each time I close and
go
back in it highlites a different line.

What is the DAO library?

Thank you

Melissa

message
What error do you get?

The fact that the previous line (Dim db As DAO.Database) doesn't
cause
problems implies that the DAO library is properly referenced.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Boyd

Thank you very much for your reply

I have imported the module as well, and when i open the calendar
form, it gives me the "debug" option:

Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim db As DAO.Database
**Dim rs As DAO.Recordset
Dim i As Integer
Dim myDate As Date

(When - debug, line with stars next to it is highlited in yellow?)

Thank you

Melissa


"Boyd Trimmell aka HiTechCoach via AccessMonster.com" <u14500@uwe>
wrote in message Melissa wrote:
Hi

I am creating a database for a security company.

I have a form for "Company" 's , "Employees" , and "Contracts
On my Company Form, I have a subform for the contract, which
works
fine
My Employees form is just where you add employee info, this is
also
ok.

Now what I would like to do, is create a form with a large
calendar
on it,
and there must be a combo box perhaps on the top of the form to
select which
Company the calendar belongs to. Then, after selecting a
company
from the
combo box, the user can double click on a day in a specific month
which then
brings up an input box to type in the names of the security
gaurds
(employees) who are working, or who have worked at that company's
premises
on that specific day.

I would also like to be able to print this calendar form to see
exaclty who
worked on which days. Would this report perhaps also be able to
give a
total number of shifts worked per gaurd (employee)?

I found a database example on the internet of a similar "Calendar
form"
which works great, However I cannot import the form and table
into
my
database - it wont work. The code for this form is also much
more
advanced
than my knowledge, so Im not sure exactly how to get it to work
in
my
database?

Please could someone assist me?

Thank you kindly

Melissa


Did you check to see if there were any code "modules" that you
also
need to
import? If there are any in the sample database, try importing
those also.
This may get the example to work in your database.

Hope this helps ....

--
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com

Message posted via AccessMonster.com
 
D

Douglas J. Steele

What you've done sounds sufficient.

When you first open the form, what appears on it? If there's nothing in
CompanyName, then the form should be empty. If not, something's wrong with
your query. Post its SQL.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
Thank you for the reply

I put the record source of the form to "qryCalendar", which I have the
field "CompanyName", and then in the criteria, i added
Forms![frmCalendar]![CompanyName]

Also - after update for combo - Me.Requery

It still shows all the records for all the companies? did I perhaps do it
incorrectly? should more fields be added to the calendar query?

Thank you

Melissa
Douglas J. Steele said:
Base the form on a query. As a criteria in the query (under the
CompanyName field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the form:
Me.Requery

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as
print the various reports.

Is there perhaps a way that I can insert a combo box on my calendar form
for "CompanyName", in which I can select a company from the list, and
then add/view information on the calendar for that specific company?

Eg. I select "ABC Trading", and then add some text in the block for
January 15th, then I select a differenct company "SEL Importers" from
the list, and the text i inserted on January 15th for ABC traders will
no longer appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa


Go into the Refererences dialog (If you're using Access 2003 or
earlier, it'll be under the Tools menu when you're in the VB Editor,
afraid I can't remember where on the ribbon it is if you're using
Access 2007, but you need to be in the VB Editor there too)

Assuming you're using an MDB, you need to find the reference for
Microsoft DAO 3.6 Object Library and select it. If you're using an
ACCDB, you need to find the reference for Microsoft Office 12.0 Access
database engine and select it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi

Error: Compile Error....User defined type not defined.
(Dim db As DAO.Database) is also highlighted, each time I close and
go back in it highlites a different line.

What is the DAO library?

Thank you

Melissa

message What error do you get?

The fact that the previous line (Dim db As DAO.Database) doesn't
cause problems implies that the DAO library is properly referenced.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Boyd

Thank you very much for your reply

I have imported the module as well, and when i open the calendar
form, it gives me the "debug" option:

Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim db As DAO.Database
**Dim rs As DAO.Recordset
Dim i As Integer
Dim myDate As Date

(When - debug, line with stars next to it is highlited in yellow?)

Thank you

Melissa


"Boyd Trimmell aka HiTechCoach via AccessMonster.com" <u14500@uwe>
wrote in message Melissa wrote:
Hi

I am creating a database for a security company.

I have a form for "Company" 's , "Employees" , and "Contracts
On my Company Form, I have a subform for the contract, which works
fine
My Employees form is just where you add employee info, this is also
ok.

Now what I would like to do, is create a form with a large calendar
on it,
and there must be a combo box perhaps on the top of the form to
select which
Company the calendar belongs to. Then, after selecting a company
from the
combo box, the user can double click on a day in a specific month
which then
brings up an input box to type in the names of the security gaurds
(employees) who are working, or who have worked at that company's
premises
on that specific day.

I would also like to be able to print this calendar form to see
exaclty who
worked on which days. Would this report perhaps also be able to
give a
total number of shifts worked per gaurd (employee)?

I found a database example on the internet of a similar "Calendar
form"
which works great, However I cannot import the form and table into
my
database - it wont work. The code for this form is also much more
advanced
than my knowledge, so Im not sure exactly how to get it to work in
my
database?

Please could someone assist me?

Thank you kindly

Melissa


Did you check to see if there were any code "modules" that you
also need to
import? If there are any in the sample database, try importing
those also.
This may get the example to work in your database.

Hope this helps ....

--
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com

Message posted via AccessMonster.com
 
M

Melissa

Thank you

When I first open the form everything is displayed. All the text boxes for
each date, the month, year, etc. also there is info in some of the "days"
text boxes.

I apologise, im not very experienced in access, im not sure what its SQL is?
In the "Row Source" of the CompanyName combo box, is the following:

SELECT tblCompany.CompanyId, tblCompany.CompanyName FROM tblCompany;

Im not sure if thats at all helpful?

Thank you kindly for your assistance

Melissa

Douglas J. Steele said:
What you've done sounds sufficient.

When you first open the form, what appears on it? If there's nothing in
CompanyName, then the form should be empty. If not, something's wrong with
your query. Post its SQL.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
Thank you for the reply

I put the record source of the form to "qryCalendar", which I have the
field "CompanyName", and then in the criteria, i added
Forms![frmCalendar]![CompanyName]

Also - after update for combo - Me.Requery

It still shows all the records for all the companies? did I perhaps do it
incorrectly? should more fields be added to the calendar query?

Thank you

Melissa
Douglas J. Steele said:
Base the form on a query. As a criteria in the query (under the
CompanyName field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the form:
Me.Requery

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as
print the various reports.

Is there perhaps a way that I can insert a combo box on my calendar
form for "CompanyName", in which I can select a company from the list,
and then add/view information on the calendar for that specific
company?

Eg. I select "ABC Trading", and then add some text in the block for
January 15th, then I select a differenct company "SEL Importers" from
the list, and the text i inserted on January 15th for ABC traders will
no longer appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa


Go into the Refererences dialog (If you're using Access 2003 or
earlier, it'll be under the Tools menu when you're in the VB Editor,
afraid I can't remember where on the ribbon it is if you're using
Access 2007, but you need to be in the VB Editor there too)

Assuming you're using an MDB, you need to find the reference for
Microsoft DAO 3.6 Object Library and select it. If you're using an
ACCDB, you need to find the reference for Microsoft Office 12.0 Access
database engine and select it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi

Error: Compile Error....User defined type not defined.
(Dim db As DAO.Database) is also highlighted, each time I close and
go back in it highlites a different line.

What is the DAO library?

Thank you

Melissa

message What error do you get?

The fact that the previous line (Dim db As DAO.Database) doesn't
cause problems implies that the DAO library is properly referenced.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Boyd

Thank you very much for your reply

I have imported the module as well, and when i open the calendar
form, it gives me the "debug" option:

Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim db As DAO.Database
**Dim rs As DAO.Recordset
Dim i As Integer
Dim myDate As Date

(When - debug, line with stars next to it is highlited in yellow?)

Thank you

Melissa


"Boyd Trimmell aka HiTechCoach via AccessMonster.com" <u14500@uwe>
wrote in message Melissa wrote:
Hi

I am creating a database for a security company.

I have a form for "Company" 's , "Employees" , and "Contracts
On my Company Form, I have a subform for the contract, which works
fine
My Employees form is just where you add employee info, this is
also ok.

Now what I would like to do, is create a form with a large
calendar on it,
and there must be a combo box perhaps on the top of the form to
select which
Company the calendar belongs to. Then, after selecting a company
from the
combo box, the user can double click on a day in a specific month
which then
brings up an input box to type in the names of the security gaurds
(employees) who are working, or who have worked at that company's
premises
on that specific day.

I would also like to be able to print this calendar form to see
exaclty who
worked on which days. Would this report perhaps also be able to
give a
total number of shifts worked per gaurd (employee)?

I found a database example on the internet of a similar "Calendar
form"
which works great, However I cannot import the form and table into
my
database - it wont work. The code for this form is also much more
advanced
than my knowledge, so Im not sure exactly how to get it to work in
my
database?

Please could someone assist me?

Thank you kindly

Melissa


Did you check to see if there were any code "modules" that you
also need to
import? If there are any in the sample database, try importing
those also.
This may get the example to work in your database.

Hope this helps ....

--
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com

Message posted via AccessMonster.com
 
D

Douglas J. Steele

No, I need to see the RecordSource for your form.

If it's the name of a query, I need to see the SQL of that query. To see the
SQL of a query, open the query in Design view, then select SQL View from the
View menu.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
Thank you

When I first open the form everything is displayed. All the text boxes
for each date, the month, year, etc. also there is info in some of the
"days" text boxes.

I apologise, im not very experienced in access, im not sure what its SQL
is?
In the "Row Source" of the CompanyName combo box, is the following:

SELECT tblCompany.CompanyId, tblCompany.CompanyName FROM tblCompany;

Im not sure if thats at all helpful?

Thank you kindly for your assistance

Melissa

Douglas J. Steele said:
What you've done sounds sufficient.

When you first open the form, what appears on it? If there's nothing in
CompanyName, then the form should be empty. If not, something's wrong
with your query. Post its SQL.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
Thank you for the reply

I put the record source of the form to "qryCalendar", which I have the
field "CompanyName", and then in the criteria, i added
Forms![frmCalendar]![CompanyName]

Also - after update for combo - Me.Requery

It still shows all the records for all the companies? did I perhaps do
it incorrectly? should more fields be added to the calendar query?

Thank you

Melissa
Base the form on a query. As a criteria in the query (under the
CompanyName field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the
form: Me.Requery

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as
print the various reports.

Is there perhaps a way that I can insert a combo box on my calendar
form for "CompanyName", in which I can select a company from the list,
and then add/view information on the calendar for that specific
company?

Eg. I select "ABC Trading", and then add some text in the block for
January 15th, then I select a differenct company "SEL Importers" from
the list, and the text i inserted on January 15th for ABC traders will
no longer appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa


message Go into the Refererences dialog (If you're using Access 2003 or
earlier, it'll be under the Tools menu when you're in the VB Editor,
afraid I can't remember where on the ribbon it is if you're using
Access 2007, but you need to be in the VB Editor there too)

Assuming you're using an MDB, you need to find the reference for
Microsoft DAO 3.6 Object Library and select it. If you're using an
ACCDB, you need to find the reference for Microsoft Office 12.0
Access database engine and select it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi

Error: Compile Error....User defined type not defined.
(Dim db As DAO.Database) is also highlighted, each time I close and
go back in it highlites a different line.

What is the DAO library?

Thank you

Melissa

message What error do you get?

The fact that the previous line (Dim db As DAO.Database) doesn't
cause problems implies that the DAO library is properly referenced.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Boyd

Thank you very much for your reply

I have imported the module as well, and when i open the calendar
form, it gives me the "debug" option:

Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim db As DAO.Database
**Dim rs As DAO.Recordset
Dim i As Integer
Dim myDate As Date

(When - debug, line with stars next to it is highlited in yellow?)

Thank you

Melissa


"Boyd Trimmell aka HiTechCoach via AccessMonster.com" <u14500@uwe>
wrote in message Melissa wrote:
Hi

I am creating a database for a security company.

I have a form for "Company" 's , "Employees" , and "Contracts
On my Company Form, I have a subform for the contract, which
works fine
My Employees form is just where you add employee info, this is
also ok.

Now what I would like to do, is create a form with a large
calendar on it,
and there must be a combo box perhaps on the top of the form to
select which
Company the calendar belongs to. Then, after selecting a
company from the
combo box, the user can double click on a day in a specific month
which then
brings up an input box to type in the names of the security
gaurds
(employees) who are working, or who have worked at that company's
premises
on that specific day.

I would also like to be able to print this calendar form to see
exaclty who
worked on which days. Would this report perhaps also be able to
give a
total number of shifts worked per gaurd (employee)?

I found a database example on the internet of a similar "Calendar
form"
which works great, However I cannot import the form and table
into my
database - it wont work. The code for this form is also much
more advanced
than my knowledge, so Im not sure exactly how to get it to work
in my
database?

Please could someone assist me?

Thank you kindly

Melissa


Did you check to see if there were any code "modules" that you
also need to
import? If there are any in the sample database, try importing
those also.
This may get the example to work in your database.

Hope this helps ....

--
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com

Message posted via AccessMonster.com
 
M

Melissa

Ok, the record source for my "frmCalendar" form , is empty....nothing is in
"RecordSource" ?


Douglas J. Steele said:
No, I need to see the RecordSource for your form.

If it's the name of a query, I need to see the SQL of that query. To see
the SQL of a query, open the query in Design view, then select SQL View
from the View menu.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Melissa said:
Thank you

When I first open the form everything is displayed. All the text boxes
for each date, the month, year, etc. also there is info in some of the
"days" text boxes.

I apologise, im not very experienced in access, im not sure what its SQL
is?
In the "Row Source" of the CompanyName combo box, is the following:

SELECT tblCompany.CompanyId, tblCompany.CompanyName FROM tblCompany;

Im not sure if thats at all helpful?

Thank you kindly for your assistance

Melissa

Douglas J. Steele said:
What you've done sounds sufficient.

When you first open the form, what appears on it? If there's nothing in
CompanyName, then the form should be empty. If not, something's wrong
with your query. Post its SQL.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Thank you for the reply

I put the record source of the form to "qryCalendar", which I have the
field "CompanyName", and then in the criteria, i added
Forms![frmCalendar]![CompanyName]

Also - after update for combo - Me.Requery

It still shows all the records for all the companies? did I perhaps do
it incorrectly? should more fields be added to the calendar query?

Thank you

Melissa
Base the form on a query. As a criteria in the query (under the
CompanyName field), put a reference to the combo box:
Forms![NameOfForm]![NameOfCompany].

In the AfterUpdate event of the combo box, put code to requery the
form: Me.Requery

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


I'm using Access 2002...

That did the trick, thank you.

My Calendar form opens, and I can add information into it, as well as
print the various reports.

Is there perhaps a way that I can insert a combo box on my calendar
form for "CompanyName", in which I can select a company from the
list, and then add/view information on the calendar for that specific
company?

Eg. I select "ABC Trading", and then add some text in the block for
January 15th, then I select a differenct company "SEL Importers" from
the list, and the text i inserted on January 15th for ABC traders
will no longer appear....and I can add records for SEL Importers?

Thank you kindly for your assistance

Melissa


message Go into the Refererences dialog (If you're using Access 2003 or
earlier, it'll be under the Tools menu when you're in the VB Editor,
afraid I can't remember where on the ribbon it is if you're using
Access 2007, but you need to be in the VB Editor there too)

Assuming you're using an MDB, you need to find the reference for
Microsoft DAO 3.6 Object Library and select it. If you're using an
ACCDB, you need to find the reference for Microsoft Office 12.0
Access database engine and select it.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Hi

Error: Compile Error....User defined type not defined.
(Dim db As DAO.Database) is also highlighted, each time I close
and go back in it highlites a different line.

What is the DAO library?

Thank you

Melissa

message What error do you get?

The fact that the previous line (Dim db As DAO.Database) doesn't
cause problems implies that the DAO library is properly
referenced.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Boyd

Thank you very much for your reply

I have imported the module as well, and when i open the calendar
form, it gives me the "debug" option:

Public Sub PutInData()
Dim sql As String
Dim f As Form
Dim db As DAO.Database
**Dim rs As DAO.Recordset
Dim i As Integer
Dim myDate As Date

(When - debug, line with stars next to it is highlited in
yellow?)

Thank you

Melissa


"Boyd Trimmell aka HiTechCoach via AccessMonster.com"
Melissa wrote:
Hi

I am creating a database for a security company.

I have a form for "Company" 's , "Employees" , and "Contracts
On my Company Form, I have a subform for the contract, which
works fine
My Employees form is just where you add employee info, this is
also ok.

Now what I would like to do, is create a form with a large
calendar on it,
and there must be a combo box perhaps on the top of the form to
select which
Company the calendar belongs to. Then, after selecting a
company from the
combo box, the user can double click on a day in a specific
month which then
brings up an input box to type in the names of the security
gaurds
(employees) who are working, or who have worked at that
company's premises
on that specific day.

I would also like to be able to print this calendar form to see
exaclty who
worked on which days. Would this report perhaps also be able to
give a
total number of shifts worked per gaurd (employee)?

I found a database example on the internet of a similar
"Calendar form"
which works great, However I cannot import the form and table
into my
database - it wont work. The code for this form is also much
more advanced
than my knowledge, so Im not sure exactly how to get it to work
in my
database?

Please could someone assist me?

Thank you kindly

Melissa


Did you check to see if there were any code "modules" that you
also need to
import? If there are any in the sample database, try importing
those also.
This may get the example to work in your database.

Hope this helps ....

--
Boyd Trimmell
aka HiTechCoach
http://www.hitechcoach.com
http://www.officeprogramming.com

Message posted via AccessMonster.com
 
D

Douglas J. Steele

Sorry, but I have no idea what example you found on the internet, so I can't
offer any other suggestions.
 
M

Melissa

No problem.

Thank you kindly for your assistance. I apologise for any inconvenience.

Thank you

Melissa
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top