I need some help please...

A

autowizz

I am trying to set up some type of judging system.
I have 28 classes in a car show, each class has a letter and car number
(a1-a20, b1-b20 and so on). The people who entered their cars are the one who
vote for 1 car in each class and mark them all down on a voting sheet, then
they turn those sheets in and the votes are counted and added up.
I am trying to set something up so that all I have to do is enter the class
letter and car number (a1, x10, etc) and the program will then store all the
votes and then add them up for me, so I know which vehicles got the most
votes in which class..

To me it sounds like it would be some sort of inventory type system or
something, I am lost and need someones help ASAP in setting this up....
 
S

strive4peace

Here is a simplified structure to accomodate your needs:

*Cars*
CarID, autonumber
OwnerID, long integer
CarNumber, number, long
(or text if it contains letters)

*CarClasses*
ClassID, autonumber
Class, text

*Shows*
ShowID, autonumber
LocID, long integer
ShowDate, date

*Owners*
OwnerID, autonumber
Lastname, text
Firstname, text

*Locations*
LocID, autonumber
Location, text

*Votes*
VoteID, autonumber
ShowID, long integer
OwnerID, long integer
ClassID, long integer
CarID, long integer, defaultValue=null

make a unique index on the combination of:
ShowID
OwnerID
ClassID


set up a form to enter Votes once all the other information
is known

main form: unbound

'~~~~~~~~~~~~~
combobox:

Name --> ShowID
ControlSource -->
RowSource -->
SELECT S.ShowID, S.ShowDate
L.Location
FROM Shows as S
INNER JOIN Locations as L
ON S.LocID = L.LocID
ORDER BY ShowDate desc, Location

BoundColumn --> 1
ColumnCount --> 3

columnWidths --> 0;1;2
(etc for however many columns you have
-- the ID column will be hidden since its width is zero)

ListWidth --> 3
(should add up to the sum of the column widths)

ShowID will be stored in the control while showing you
information from another table...

Since the first column, ShowID, has a width of 0, what shows
up in the combobox will be the seoncd column, ShowDate. To
display the Location, use a calculated control:

Name --> Location
ControlSource --> = ShowID.column(2)

column indexes start with 0, not 1 in Access -- so column
index= 2 is really column 3

'~~~~~~~~~~~~~
combo:
Name --> OwnerID
ControlSource -->
RowSource -->
SELECT OwnerID,
Firstname & ' ' & Lastname as Owner
FROM Owners
ORDER BY Firstname, Lastname

BoundColumn --> 1
ColumnCount --> 2

columnWidths --> 0;1.5

ListWidth --> 1.5

'~~~~~~~~~~~~~
command button:

Name --> cmdCreateRecords
Caption --> Create Vote Records

OnClick --> [Event Procedure]

'~~~~~~~~~
'(this is whose vote card it is)
if isnull(me.OwnerID) then
msgbox "Specify Owner",,"Missing data"
exit sub
end if

if isnull(me.ShowID) then
msgbox "Specify Show",,"Missing data"
exit sub
end if

dim s as string
s = "INSERT INTO Votes " _
& " (ShowID, OwnerID, ClassID) " _
& " SELECT " _
& me.ShowID & ", " _
& me.OwnerID & ", " _
& " CarClasses.ClassID "
& " FROM Votes, CarClasses;"
debug.print s
currentdb.execute s

currentdb.tabledefs.refresh
DoEvents

me.vote_subform_controlname.form.requery

'~~~~~~~~~
'~~~~~~~~~
'~~~~~~~~~

As you can see, I have referenced a subform for the Votes

Make a continuouse subform:
RecordSource --> Votes


VoteID: textbox, Locked=true, TabStop=false

ShowID: textbox, Visible=false
(can go in form header or footer)

OwnerID: textbox, Visible=false
(can go in form header or footer)

ClassID: combobox, Locked=true, TabStop=false
CarID: combobox
(this is the only control you will enter information into)

Now save the (sub)form and close it

'~~~~~~~~~
go back to the design view of the mainform

make a subform control:

sourceObject --> your Vote form name
Name --> YourVoteFormName
LinkMasterFields --> ShowID; OwnerID
LinkChildFields --> ShowID; OwnerID


this should get you started :)



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
 
A

autowizz

That looks great, only problem I have is, I have never really used access to
set anything up before so I am lost at how to do everything you wrote down.
Any suggestions on what I can do or is there someone out there that can set
it up for me and email it to me? I would be indebted forever...



strive4peace" <"strive4peace2006 at yaho said:
Here is a simplified structure to accomodate your needs:

*Cars*
CarID, autonumber
OwnerID, long integer
CarNumber, number, long
(or text if it contains letters)

*CarClasses*
ClassID, autonumber
Class, text

*Shows*
ShowID, autonumber
LocID, long integer
ShowDate, date

*Owners*
OwnerID, autonumber
Lastname, text
Firstname, text

*Locations*
LocID, autonumber
Location, text

*Votes*
VoteID, autonumber
ShowID, long integer
OwnerID, long integer
ClassID, long integer
CarID, long integer, defaultValue=null

make a unique index on the combination of:
ShowID
OwnerID
ClassID


set up a form to enter Votes once all the other information
is known

main form: unbound

'~~~~~~~~~~~~~
combobox:

Name --> ShowID
ControlSource -->
RowSource -->
SELECT S.ShowID, S.ShowDate
L.Location
FROM Shows as S
INNER JOIN Locations as L
ON S.LocID = L.LocID
ORDER BY ShowDate desc, Location

BoundColumn --> 1
ColumnCount --> 3

columnWidths --> 0;1;2
(etc for however many columns you have
-- the ID column will be hidden since its width is zero)

ListWidth --> 3
(should add up to the sum of the column widths)

ShowID will be stored in the control while showing you
information from another table...

Since the first column, ShowID, has a width of 0, what shows
up in the combobox will be the seoncd column, ShowDate. To
display the Location, use a calculated control:

Name --> Location
ControlSource --> = ShowID.column(2)

column indexes start with 0, not 1 in Access -- so column
index= 2 is really column 3

'~~~~~~~~~~~~~
combo:
Name --> OwnerID
ControlSource -->
RowSource -->
SELECT OwnerID,
Firstname & ' ' & Lastname as Owner
FROM Owners
ORDER BY Firstname, Lastname

BoundColumn --> 1
ColumnCount --> 2

columnWidths --> 0;1.5

ListWidth --> 1.5

'~~~~~~~~~~~~~
command button:

Name --> cmdCreateRecords
Caption --> Create Vote Records

OnClick --> [Event Procedure]

'~~~~~~~~~
'(this is whose vote card it is)
if isnull(me.OwnerID) then
msgbox "Specify Owner",,"Missing data"
exit sub
end if

if isnull(me.ShowID) then
msgbox "Specify Show",,"Missing data"
exit sub
end if

dim s as string
s = "INSERT INTO Votes " _
& " (ShowID, OwnerID, ClassID) " _
& " SELECT " _
& me.ShowID & ", " _
& me.OwnerID & ", " _
& " CarClasses.ClassID "
& " FROM Votes, CarClasses;"
debug.print s
currentdb.execute s

currentdb.tabledefs.refresh
DoEvents

me.vote_subform_controlname.form.requery

'~~~~~~~~~
'~~~~~~~~~
'~~~~~~~~~

As you can see, I have referenced a subform for the Votes

Make a continuouse subform:
RecordSource --> Votes


VoteID: textbox, Locked=true, TabStop=false

ShowID: textbox, Visible=false
(can go in form header or footer)

OwnerID: textbox, Visible=false
(can go in form header or footer)

ClassID: combobox, Locked=true, TabStop=false
CarID: combobox
(this is the only control you will enter information into)

Now save the (sub)form and close it

'~~~~~~~~~
go back to the design view of the mainform

make a subform control:

sourceObject --> your Vote form name
Name --> YourVoteFormName
LinkMasterFields --> ShowID; OwnerID
LinkChildFields --> ShowID; OwnerID


this should get you started :)



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
I am trying to set up some type of judging system.
I have 28 classes in a car show, each class has a letter and car number
(a1-a20, b1-b20 and so on). The people who entered their cars are the one who
vote for 1 car in each class and mark them all down on a voting sheet, then
they turn those sheets in and the votes are counted and added up.
I am trying to set something up so that all I have to do is enter the class
letter and car number (a1, x10, etc) and the program will then store all the
votes and then add them up for me, so I know which vehicles got the most
votes in which class..

To me it sounds like it would be some sort of inventory type system or
something, I am lost and need someones help ASAP in setting this up....
 
S

strive4peace

Don't be afraid to try what I have suggested ...

firstly, turn off or cancel any wizard that pops up to help
you, I gave you the properties you need to set.

~~~
To create a table, from the database window, click on the
Tables tab -- once there, click the NEW button -- choose
Design view and type in what I gave you.

For Long Integer, choose Number data type and then Long
Integer is the default size in thew lower pane.

Make sure to fill out field descriptions even if all you do
is put the fieldname in there. Don't use spaces or special
characters other than _ in your fieldnames

~~~
To create a new form, click the NEW button in the forms window

Once in the form design view, turn on Properties
View, Properties from the menu

The Properties window will display properties about whatever
is selected (look in its title bar)

To select the form itself, click where the Rulers intersect
in the upper left corner

Turn on the toolbox (hammer & wrench icon)

Turn on the fieldlist (once you pick form RecordSource, it
will fill up)

To make a control on the form, click the tool you want (ie:
combobox), then drag a field from the fieldlist onto the form

Hopefully, this gets you started -- gotta run now ...



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
That looks great, only problem I have is, I have never really used access to
set anything up before so I am lost at how to do everything you wrote down.
Any suggestions on what I can do or is there someone out there that can set
it up for me and email it to me? I would be indebted forever...



:

Here is a simplified structure to accomodate your needs:

*Cars*
CarID, autonumber
OwnerID, long integer
CarNumber, number, long
(or text if it contains letters)

*CarClasses*
ClassID, autonumber
Class, text

*Shows*
ShowID, autonumber
LocID, long integer
ShowDate, date

*Owners*
OwnerID, autonumber
Lastname, text
Firstname, text

*Locations*
LocID, autonumber
Location, text

*Votes*
VoteID, autonumber
ShowID, long integer
OwnerID, long integer
ClassID, long integer
CarID, long integer, defaultValue=null

make a unique index on the combination of:
ShowID
OwnerID
ClassID


set up a form to enter Votes once all the other information
is known

main form: unbound

'~~~~~~~~~~~~~
combobox:

Name --> ShowID
ControlSource -->
RowSource -->
SELECT S.ShowID, S.ShowDate
L.Location
FROM Shows as S
INNER JOIN Locations as L
ON S.LocID = L.LocID
ORDER BY ShowDate desc, Location

BoundColumn --> 1
ColumnCount --> 3

columnWidths --> 0;1;2
(etc for however many columns you have
-- the ID column will be hidden since its width is zero)

ListWidth --> 3
(should add up to the sum of the column widths)

ShowID will be stored in the control while showing you
information from another table...

Since the first column, ShowID, has a width of 0, what shows
up in the combobox will be the seoncd column, ShowDate. To
display the Location, use a calculated control:

Name --> Location
ControlSource --> = ShowID.column(2)

column indexes start with 0, not 1 in Access -- so column
index= 2 is really column 3

'~~~~~~~~~~~~~
combo:
Name --> OwnerID
ControlSource -->
RowSource -->
SELECT OwnerID,
Firstname & ' ' & Lastname as Owner
FROM Owners
ORDER BY Firstname, Lastname

BoundColumn --> 1
ColumnCount --> 2

columnWidths --> 0;1.5

ListWidth --> 1.5

'~~~~~~~~~~~~~
command button:

Name --> cmdCreateRecords
Caption --> Create Vote Records

OnClick --> [Event Procedure]

'~~~~~~~~~
'(this is whose vote card it is)
if isnull(me.OwnerID) then
msgbox "Specify Owner",,"Missing data"
exit sub
end if

if isnull(me.ShowID) then
msgbox "Specify Show",,"Missing data"
exit sub
end if

dim s as string
s = "INSERT INTO Votes " _
& " (ShowID, OwnerID, ClassID) " _
& " SELECT " _
& me.ShowID & ", " _
& me.OwnerID & ", " _
& " CarClasses.ClassID "
& " FROM Votes, CarClasses;"
debug.print s
currentdb.execute s

currentdb.tabledefs.refresh
DoEvents

me.vote_subform_controlname.form.requery

'~~~~~~~~~
'~~~~~~~~~
'~~~~~~~~~

As you can see, I have referenced a subform for the Votes

Make a continuouse subform:
RecordSource --> Votes


VoteID: textbox, Locked=true, TabStop=false

ShowID: textbox, Visible=false
(can go in form header or footer)

OwnerID: textbox, Visible=false
(can go in form header or footer)

ClassID: combobox, Locked=true, TabStop=false
CarID: combobox
(this is the only control you will enter information into)

Now save the (sub)form and close it

'~~~~~~~~~
go back to the design view of the mainform

make a subform control:

sourceObject --> your Vote form name
Name --> YourVoteFormName
LinkMasterFields --> ShowID; OwnerID
LinkChildFields --> ShowID; OwnerID


this should get you started :)



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
I am trying to set up some type of judging system.
I have 28 classes in a car show, each class has a letter and car number
(a1-a20, b1-b20 and so on). The people who entered their cars are the one who
vote for 1 car in each class and mark them all down on a voting sheet, then
they turn those sheets in and the votes are counted and added up.
I am trying to set something up so that all I have to do is enter the class
letter and car number (a1, x10, etc) and the program will then store all the
votes and then add them up for me, so I know which vehicles got the most
votes in which class..

To me it sounds like it would be some sort of inventory type system or
something, I am lost and need someones help ASAP in setting this up....
 
S

strive4peace

.... have a little more time now ...

to turn on the Fieldlist, you can choose View, Fieldlist
from the menu

Since you have not bound the form, the fieldlist will be empty

If the form rulers are not showing above and to the left of
your design area...
View, Rulers from the menu

In my last post, I told you to open the Properties window
(one way is View, Properties from the menu)...

Now select the form itself (in case you clicked somewhere
else -- the titlebar of Properties will say "Form" if the
form is the selection).

~~~
in the Properties window, the properties are catagorized 5 ways:

Format
Data
Event
Other
All

Click on the data tab for the form

click in the RecordSource property

click on the drop-list for your table

If the form is unbound, you do not select a RecordSource




Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Don't be afraid to try what I have suggested ...

firstly, turn off or cancel any wizard that pops up to help you, I gave
you the properties you need to set.

~~~
To create a table, from the database window, click on the Tables tab --
once there, click the NEW button -- choose Design view and type in what
I gave you.

For Long Integer, choose Number data type and then Long Integer is the
default size in thew lower pane.

Make sure to fill out field descriptions even if all you do is put the
fieldname in there. Don't use spaces or special characters other than _
in your fieldnames

~~~
To create a new form, click the NEW button in the forms window

Once in the form design view, turn on Properties
View, Properties from the menu

The Properties window will display properties about whatever is selected
(look in its title bar)

To select the form itself, click where the Rulers intersect in the upper
left corner

Turn on the toolbox (hammer & wrench icon)

Turn on the fieldlist (once you pick form RecordSource, it will fill up)

To make a control on the form, click the tool you want (ie: combobox),
then drag a field from the fieldlist onto the form

Hopefully, this gets you started -- gotta run now ...



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
That looks great, only problem I have is, I have never really used
access to set anything up before so I am lost at how to do everything
you wrote down. Any suggestions on what I can do or is there someone
out there that can set it up for me and email it to me? I would be
indebted forever...



:

Here is a simplified structure to accomodate your needs:

*Cars*
CarID, autonumber
OwnerID, long integer
CarNumber, number, long
(or text if it contains letters)

*CarClasses*
ClassID, autonumber
Class, text

*Shows*
ShowID, autonumber
LocID, long integer
ShowDate, date

*Owners*
OwnerID, autonumber
Lastname, text
Firstname, text

*Locations*
LocID, autonumber
Location, text

*Votes*
VoteID, autonumber
ShowID, long integer
OwnerID, long integer
ClassID, long integer
CarID, long integer, defaultValue=null

make a unique index on the combination of:
ShowID
OwnerID
ClassID


set up a form to enter Votes once all the other information is known

main form: unbound

'~~~~~~~~~~~~~
combobox:

Name --> ShowID
ControlSource -->
RowSource -->
SELECT S.ShowID, S.ShowDate
L.Location
FROM Shows as S
INNER JOIN Locations as L
ON S.LocID = L.LocID
ORDER BY ShowDate desc, Location

BoundColumn --> 1
ColumnCount --> 3

columnWidths --> 0;1;2
(etc for however many columns you have
-- the ID column will be hidden since its width is zero)

ListWidth --> 3
(should add up to the sum of the column widths)

ShowID will be stored in the control while showing you information
from another table...

Since the first column, ShowID, has a width of 0, what shows up in
the combobox will be the seoncd column, ShowDate. To display the
Location, use a calculated control:

Name --> Location
ControlSource --> = ShowID.column(2)

column indexes start with 0, not 1 in Access -- so column index= 2 is
really column 3

'~~~~~~~~~~~~~
combo:
Name --> OwnerID
ControlSource -->
RowSource -->
SELECT OwnerID,
Firstname & ' ' & Lastname as Owner
FROM Owners
ORDER BY Firstname, Lastname

BoundColumn --> 1
ColumnCount --> 2

columnWidths --> 0;1.5

ListWidth --> 1.5

'~~~~~~~~~~~~~
command button:

Name --> cmdCreateRecords
Caption --> Create Vote Records

OnClick --> [Event Procedure]

'~~~~~~~~~
'(this is whose vote card it is)
if isnull(me.OwnerID) then
msgbox "Specify Owner",,"Missing data"
exit sub
end if

if isnull(me.ShowID) then
msgbox "Specify Show",,"Missing data"
exit sub
end if

dim s as string
s = "INSERT INTO Votes " _
& " (ShowID, OwnerID, ClassID) " _
& " SELECT " _
& me.ShowID & ", " _
& me.OwnerID & ", " _
& " CarClasses.ClassID "
& " FROM Votes, CarClasses;"
debug.print s
currentdb.execute s

currentdb.tabledefs.refresh
DoEvents

me.vote_subform_controlname.form.requery

'~~~~~~~~~
'~~~~~~~~~
'~~~~~~~~~

As you can see, I have referenced a subform for the Votes

Make a continuouse subform:
RecordSource --> Votes


VoteID: textbox, Locked=true, TabStop=false

ShowID: textbox, Visible=false
(can go in form header or footer)

OwnerID: textbox, Visible=false
(can go in form header or footer)

ClassID: combobox, Locked=true, TabStop=false
CarID: combobox
(this is the only control you will enter information into)

Now save the (sub)form and close it

'~~~~~~~~~
go back to the design view of the mainform

make a subform control:

sourceObject --> your Vote form name
Name --> YourVoteFormName
LinkMasterFields --> ShowID; OwnerID
LinkChildFields --> ShowID; OwnerID


this should get you started :)



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

autowizz wrote:

I am trying to set up some type of judging system.
I have 28 classes in a car show, each class has a letter and car
number (a1-a20, b1-b20 and so on). The people who entered their cars
are the one who vote for 1 car in each class and mark them all down
on a voting sheet, then they turn those sheets in and the votes are
counted and added up.
I am trying to set something up so that all I have to do is enter
the class letter and car number (a1, x10, etc) and the program will
then store all the votes and then add them up for me, so I know
which vehicles got the most votes in which class..

To me it sounds like it would be some sort of inventory type system
or something, I am lost and need someones help ASAP in setting this
up....
 
A

autowizz

Well I have tried what you said, but I am totally lost. Sorry.



strive4peace" <"strive4peace2006 at yaho said:
.... have a little more time now ...

to turn on the Fieldlist, you can choose View, Fieldlist
from the menu

Since you have not bound the form, the fieldlist will be empty

If the form rulers are not showing above and to the left of
your design area...
View, Rulers from the menu

In my last post, I told you to open the Properties window
(one way is View, Properties from the menu)...

Now select the form itself (in case you clicked somewhere
else -- the titlebar of Properties will say "Form" if the
form is the selection).

~~~
in the Properties window, the properties are catagorized 5 ways:

Format
Data
Event
Other
All

Click on the data tab for the form

click in the RecordSource property

click on the drop-list for your table

If the form is unbound, you do not select a RecordSource




Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Don't be afraid to try what I have suggested ...

firstly, turn off or cancel any wizard that pops up to help you, I gave
you the properties you need to set.

~~~
To create a table, from the database window, click on the Tables tab --
once there, click the NEW button -- choose Design view and type in what
I gave you.

For Long Integer, choose Number data type and then Long Integer is the
default size in thew lower pane.

Make sure to fill out field descriptions even if all you do is put the
fieldname in there. Don't use spaces or special characters other than _
in your fieldnames

~~~
To create a new form, click the NEW button in the forms window

Once in the form design view, turn on Properties
View, Properties from the menu

The Properties window will display properties about whatever is selected
(look in its title bar)

To select the form itself, click where the Rulers intersect in the upper
left corner

Turn on the toolbox (hammer & wrench icon)

Turn on the fieldlist (once you pick form RecordSource, it will fill up)

To make a control on the form, click the tool you want (ie: combobox),
then drag a field from the fieldlist onto the form

Hopefully, this gets you started -- gotta run now ...



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
That looks great, only problem I have is, I have never really used
access to set anything up before so I am lost at how to do everything
you wrote down. Any suggestions on what I can do or is there someone
out there that can set it up for me and email it to me? I would be
indebted forever...



:


Here is a simplified structure to accomodate your needs:

*Cars*
CarID, autonumber
OwnerID, long integer
CarNumber, number, long
(or text if it contains letters)

*CarClasses*
ClassID, autonumber
Class, text

*Shows*
ShowID, autonumber
LocID, long integer
ShowDate, date

*Owners*
OwnerID, autonumber
Lastname, text
Firstname, text

*Locations*
LocID, autonumber
Location, text

*Votes*
VoteID, autonumber
ShowID, long integer
OwnerID, long integer
ClassID, long integer
CarID, long integer, defaultValue=null

make a unique index on the combination of:
ShowID
OwnerID
ClassID


set up a form to enter Votes once all the other information is known

main form: unbound

'~~~~~~~~~~~~~
combobox:

Name --> ShowID
ControlSource -->
RowSource -->
SELECT S.ShowID, S.ShowDate
L.Location
FROM Shows as S
INNER JOIN Locations as L
ON S.LocID = L.LocID
ORDER BY ShowDate desc, Location

BoundColumn --> 1
ColumnCount --> 3

columnWidths --> 0;1;2
(etc for however many columns you have
-- the ID column will be hidden since its width is zero)

ListWidth --> 3
(should add up to the sum of the column widths)

ShowID will be stored in the control while showing you information
from another table...

Since the first column, ShowID, has a width of 0, what shows up in
the combobox will be the seoncd column, ShowDate. To display the
Location, use a calculated control:

Name --> Location
ControlSource --> = ShowID.column(2)

column indexes start with 0, not 1 in Access -- so column index= 2 is
really column 3

'~~~~~~~~~~~~~
combo:
Name --> OwnerID
ControlSource -->
RowSource -->
SELECT OwnerID,
Firstname & ' ' & Lastname as Owner
FROM Owners
ORDER BY Firstname, Lastname

BoundColumn --> 1
ColumnCount --> 2

columnWidths --> 0;1.5

ListWidth --> 1.5

'~~~~~~~~~~~~~
command button:

Name --> cmdCreateRecords
Caption --> Create Vote Records

OnClick --> [Event Procedure]

'~~~~~~~~~
'(this is whose vote card it is)
if isnull(me.OwnerID) then
msgbox "Specify Owner",,"Missing data"
exit sub
end if

if isnull(me.ShowID) then
msgbox "Specify Show",,"Missing data"
exit sub
end if

dim s as string
s = "INSERT INTO Votes " _
& " (ShowID, OwnerID, ClassID) " _
& " SELECT " _
& me.ShowID & ", " _
& me.OwnerID & ", " _
& " CarClasses.ClassID "
& " FROM Votes, CarClasses;"
debug.print s
currentdb.execute s

currentdb.tabledefs.refresh
DoEvents

me.vote_subform_controlname.form.requery

'~~~~~~~~~
'~~~~~~~~~
'~~~~~~~~~

As you can see, I have referenced a subform for the Votes

Make a continuouse subform:
RecordSource --> Votes


VoteID: textbox, Locked=true, TabStop=false

ShowID: textbox, Visible=false
(can go in form header or footer)

OwnerID: textbox, Visible=false
(can go in form header or footer)

ClassID: combobox, Locked=true, TabStop=false
CarID: combobox
(this is the only control you will enter information into)

Now save the (sub)form and close it

'~~~~~~~~~
go back to the design view of the mainform

make a subform control:

sourceObject --> your Vote form name
Name --> YourVoteFormName
LinkMasterFields --> ShowID; OwnerID
LinkChildFields --> ShowID; OwnerID


this should get you started :)



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

autowizz wrote:
 
S

strive4peace

1. print out the posts

2. read them with a highlighter in your hand

3. go to sleep

4. try it in the morning

Honestly, if you just try to do each step with a fresh mind,
you will surprise yourself!

Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Well I have tried what you said, but I am totally lost. Sorry.



:

.... have a little more time now ...

to turn on the Fieldlist, you can choose View, Fieldlist
from the menu

Since you have not bound the form, the fieldlist will be empty

If the form rulers are not showing above and to the left of
your design area...
View, Rulers from the menu

In my last post, I told you to open the Properties window
(one way is View, Properties from the menu)...

Now select the form itself (in case you clicked somewhere
else -- the titlebar of Properties will say "Form" if the
form is the selection).

~~~
in the Properties window, the properties are catagorized 5 ways:

Format
Data
Event
Other
All

Click on the data tab for the form

click in the RecordSource property

click on the drop-list for your table

If the form is unbound, you do not select a RecordSource




Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*
Don't be afraid to try what I have suggested ...

firstly, turn off or cancel any wizard that pops up to help you, I gave
you the properties you need to set.

~~~
To create a table, from the database window, click on the Tables tab --
once there, click the NEW button -- choose Design view and type in what
I gave you.

For Long Integer, choose Number data type and then Long Integer is the
default size in thew lower pane.

Make sure to fill out field descriptions even if all you do is put the
fieldname in there. Don't use spaces or special characters other than _
in your fieldnames

~~~
To create a new form, click the NEW button in the forms window

Once in the form design view, turn on Properties
View, Properties from the menu

The Properties window will display properties about whatever is selected
(look in its title bar)

To select the form itself, click where the Rulers intersect in the upper
left corner

Turn on the toolbox (hammer & wrench icon)

Turn on the fieldlist (once you pick form RecordSource, it will fill up)

To make a control on the form, click the tool you want (ie: combobox),
then drag a field from the fieldlist onto the form

Hopefully, this gets you started -- gotta run now ...



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

autowizz wrote:


That looks great, only problem I have is, I have never really used
access to set anything up before so I am lost at how to do everything
you wrote down. Any suggestions on what I can do or is there someone
out there that can set it up for me and email it to me? I would be
indebted forever...



:



Here is a simplified structure to accomodate your needs:

*Cars*
CarID, autonumber
OwnerID, long integer
CarNumber, number, long
(or text if it contains letters)

*CarClasses*
ClassID, autonumber
Class, text

*Shows*
ShowID, autonumber
LocID, long integer
ShowDate, date

*Owners*
OwnerID, autonumber
Lastname, text
Firstname, text

*Locations*
LocID, autonumber
Location, text

*Votes*
VoteID, autonumber
ShowID, long integer
OwnerID, long integer
ClassID, long integer
CarID, long integer, defaultValue=null

make a unique index on the combination of:
ShowID
OwnerID
ClassID


set up a form to enter Votes once all the other information is known

main form: unbound

'~~~~~~~~~~~~~
combobox:

Name --> ShowID
ControlSource -->
RowSource -->
SELECT S.ShowID, S.ShowDate
L.Location
FROM Shows as S
INNER JOIN Locations as L
ON S.LocID = L.LocID
ORDER BY ShowDate desc, Location

BoundColumn --> 1
ColumnCount --> 3

columnWidths --> 0;1;2
(etc for however many columns you have
-- the ID column will be hidden since its width is zero)

ListWidth --> 3
(should add up to the sum of the column widths)

ShowID will be stored in the control while showing you information
from another table...

Since the first column, ShowID, has a width of 0, what shows up in
the combobox will be the seoncd column, ShowDate. To display the
Location, use a calculated control:

Name --> Location
ControlSource --> = ShowID.column(2)

column indexes start with 0, not 1 in Access -- so column index= 2 is
really column 3

'~~~~~~~~~~~~~
combo:
Name --> OwnerID
ControlSource -->
RowSource -->
SELECT OwnerID,
Firstname & ' ' & Lastname as Owner
FROM Owners
ORDER BY Firstname, Lastname

BoundColumn --> 1
ColumnCount --> 2

columnWidths --> 0;1.5

ListWidth --> 1.5

'~~~~~~~~~~~~~
command button:

Name --> cmdCreateRecords
Caption --> Create Vote Records

OnClick --> [Event Procedure]

'~~~~~~~~~
'(this is whose vote card it is)
if isnull(me.OwnerID) then
msgbox "Specify Owner",,"Missing data"
exit sub
end if

if isnull(me.ShowID) then
msgbox "Specify Show",,"Missing data"
exit sub
end if

dim s as string
s = "INSERT INTO Votes " _
& " (ShowID, OwnerID, ClassID) " _
& " SELECT " _
& me.ShowID & ", " _
& me.OwnerID & ", " _
& " CarClasses.ClassID "
& " FROM Votes, CarClasses;"
debug.print s
currentdb.execute s

currentdb.tabledefs.refresh
DoEvents

me.vote_subform_controlname.form.requery

'~~~~~~~~~
'~~~~~~~~~
'~~~~~~~~~

As you can see, I have referenced a subform for the Votes

Make a continuouse subform:
RecordSource --> Votes


VoteID: textbox, Locked=true, TabStop=false

ShowID: textbox, Visible=false
(can go in form header or footer)

OwnerID: textbox, Visible=false
(can go in form header or footer)

ClassID: combobox, Locked=true, TabStop=false
CarID: combobox
(this is the only control you will enter information into)

Now save the (sub)form and close it

'~~~~~~~~~
go back to the design view of the mainform

make a subform control:

sourceObject --> your Vote form name
Name --> YourVoteFormName
LinkMasterFields --> ShowID; OwnerID
LinkChildFields --> ShowID; OwnerID


this should get you started :)



Warm Regards,
Crystal
Microsoft Access MVP 2006

*
Have an awesome day ;)

remote programming and training
strive4peace2006 at yahoo.com

*

autowizz wrote:
 

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