creating new database

L

LTOSH

(Access 2000)
i want to create a database to manage clients where i can create exercise
workouts, manage body measurements and create reports even possible have a
billing section for services. At present i have a "Client" table and an
"Exercise" table. the "client" table has basic personal info (name addy
phone). the "exercise" table has exercise name, description, sets, reps,
weight. I want to link the two tables when I create a workout for 1 specific
client. Where do i create this "Workout" portion (table, query, form)? How
do I associate the two tables? I want to be able to open a form, click a
client and create a workout. I'm braindead on where to begin.

thanks for all help.
 
L

LTOSH

thanks for quick response!
first...i know (PK) = primary key...what is (FK)?

I have created a "workout" table that has WorkoutID as(PK) then i have as
fields, ClientID(which is from my "client" table) and i have ExerciseID
(from my "exercise" table) Exercise Name (that would pull from "exercise"
table), sets, reps, weight (sets reps weight to be filled in when create
workout) and description (from "execise"table).

i have a form (using as switchboard) where i want to put a command button to
create workout. how can i put on that popup form a small window on the left
that lists clients to click...then a window like a datasheet on the right
that would show added exercises with the "workout" table fields. (my add
exercise would be a command button at bottom that would popup the exercises
table for me to select the specific exercise that i want to add.

i have created a database before but for some reason i am having trouble
setting this one up. i hope i make sense...any thoughts.
 
G

Gina Whipp

FK = Foreign Key (Indexed but duplicates okay - for Relationships)

As for the form set-up... List Box for Clients... another list box to show
which exercises they already have (this would change depending on the Client
selected) and then a continuous form for adding new exercises to that Client
(that would be the new table tblWorkout). All tied together via ClientID.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
L

LTOSH

thanks so much for help...will give it all a try...may be back for more help
but this gets me going in right direction!
 
K

Keith Wilby

LTOSH said:
i have a form (using as switchboard) where i want to put a command button
to
create workout. how can i put on that popup form a small window on the
left
that lists clients to click...then a window like a datasheet on the right

Whoa! First things first! Get your tables, relationships and indexing
sorted out before you start thinking about whistles and bells in your GUI.
If you don't have a solid foundation of tables to build your application on
then it may well end up collapsing around you and you'll have some re-work
at the very least.

2p supplied :)

Keith.
www.keithwilby.co.uk
 
G

Gina Whipp

Keith,

In his first eMail he asked about his table set-up and he now has a Client
table, Exercise table and a Workout table pulling those the first two tables
togehter. You might not have seen those postings,

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
L

LTOSH

Hi Gina...thanks for support here! By the way...I'm a 'her' hehehe.

ok...here is where i am and need help i think with relationships. As i
stated in first email i want to click a client name then add information
specific only to that client. Here is what i have going on.

Main Switchboard I have a list box with client name. Then I have command
buttons to take me to other specific switchboards (ex. Weightlifting,
Cardio). I want to click the client name then click the command button
"WEIGHTLIFTING" to take me to this switchboard. Once on the "WEIGHTLIFTING"
screen i have a list box "workout date" and a listbox "Workout". Here is
where i want the relationship of "workout date' and "client" to be
associated, to be specific to this client. I also want "workout date" to be
specific to specific dates. Example. for 02/07/09 i have chosen specific
exercises. for 02/08/09 i want specific exercises. How do i make these
associations or relationships? i hope i make sense.

Just for clarity...i have 3 tables..."CLIENT" "EXERCISES" "WORKOUT"
"WORKOUT" table is where the new created workouts would be stored.

Thanks so much for help! This is so exciting this coming together.
 
L

LTOSH

Hi Gina, thanks for your support here! By the way, I am a "HER" hehehe

Here is where I am...as i stated in the original post i want to click a
client name then add workout information only to that specific client. here
is what i have going so far.

Main switchboard has listbox with "client name". i have command button
labeled "weightlifting" when clicked takes me to a second switchboard (form).
i want to click a specific client then click the "weightlifting" button to
go to this switchboard to begin adding workouts to this client. On the
"weightlifting" form i have a list box labeled "workout date" and "workout".
there is a command button labeled "Add Workout" which takes to a form to type
the workout date then pick exercises, input sets, reps, weight. there is a
save button. Ex. on 02/07/09 i want to add specific exercises and
information. then for 02/08/09 i want to add specific exercises. on the
"weight lifting" form i want to see those specific dates listed and when
clicked i see the specific exercises.

how do i make these associations? client to workout date to workouts? I
hope this makes sense. just for clarity i have 3 tables. "CLIENTS"
"EXERCISES" "WORKOUTS".
the "WORKOUTS" table is where this new information will be stored.

on the main page, when i click on a different client and go to weightlifting
i want to see the workouts specific to that client.

help....
 
G

Gina Whipp

LTOSH,

"...I'm a 'her' hehehe..." Oops, my mistake... Sorry about that!

Did you try to use the command button wizard? If the wizard failed then
tell me the exact name of the form(s) you are strying to open.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
L

LTOSH

my forms are opening fine. it's the information that is not associating with
the specific client. eventhough i click one specific client and go into the
weightlifting page and adding information it is not associated with that one
specific client. does that make sense?
 
L

LTOSH

ClientID is my PK and is autonumber.

copy/paste what code?? where do i get the code you are asking for?
 
G

Gina Whipp

You have a button that is opening the form but not with the correct
information, so...

Go to deisgn mode of the form that has the button...
Click on the button and bring up properties and then go do to the On-Click
event procedure and click the button with the dots on it...
Then copy everything between Private Sub and End Sub

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
L

LTOSH

what if i used a tab control?? have the workout date as a beginning date
then the tab control with tabs labeled...day 1, day 2, day 3, day 4, abs,
cardio. that might be easier to do. but how do i do this for each client?
maybe my tables are not as they should be??
 
L

LTOSH

Private Sub Add_Workout_Click()
On Error GoTo Err_Add_Workout_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Workout Details"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Add_Workout_Click:
Exit Sub

Err_Add_Workout_Click:
MsgBox Err.Description
Resume Exit_Add_Workout_Click

End Sub


This is on my weightlifting form...the button is Add Workout. This opens
the Workout details screen. this is where i could type the workout date.
then there is a command button named add exercise. here is the code for this
button.
Private Sub Add_Exercise_Click()
On Error GoTo Err_Add_Exercise_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Add Exercise"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Add_Exercise_Click:
Exit Sub

Err_Add_Exercise_Click:
MsgBox Err.Description
Resume Exit_Add_Exercise_Click

End Sub

This opens a form to add the exercise that is a combo box so i can pick the
exercise i want to add, then fill in sets, reps weight. i am able to do all
this but it is not client specific.

maybe i'm making this harder than it has to be?
 
G

Gina Whipp

LTOSH,

Deeeeeep breath...

You can use tab controls and yes they too can be connected to each Client.
Your tables are fine. Think of them like the foundation to a house. You
don't need to change the foundation becuase you decided to switch the rooms
around. You just have to decide if you want to go the way you are going or
use tab controls... I am going to go on to your other post to look at the
code you provided.

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
G

Gina Whipp

Private Sub Add_Workout_Click()
On Error GoTo Err_Add_Workout_Click

DoCmd.OpenForm "Workout Details", , , "[ClientID]=" &
Me![NameOfYourListBox]

Exit_Add_Workout_Click:
Exit Sub

Err_Add_Workout_Click:
MsgBox Err.Description
Resume Exit_Add_Workout_Click

End Sub


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
L

LTOSH

yes Deeeeeeep breath...sorry get OCD when it comes to this hahaha.

ok, in your code below. Do i put in the [nameofyourlistbox] the "workout
date" for that list box? is that right or which listbox?

when i put it in my code...the is the error i get...Syntax error (missing
operator) in query expression '[ClientID]='.

Gina Whipp said:
Private Sub Add_Workout_Click()
On Error GoTo Err_Add_Workout_Click

DoCmd.OpenForm "Workout Details", , , "[ClientID]=" &
Me![NameOfYourListBox]

Exit_Add_Workout_Click:
Exit Sub

Err_Add_Workout_Click:
MsgBox Err.Description
Resume Exit_Add_Workout_Click

End Sub


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

LTOSH said:
Private Sub Add_Workout_Click()
On Error GoTo Err_Add_Workout_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Workout Details"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Add_Workout_Click:
Exit Sub

Err_Add_Workout_Click:
MsgBox Err.Description
Resume Exit_Add_Workout_Click

End Sub


This is on my weightlifting form...the button is Add Workout. This opens
the Workout details screen. this is where i could type the workout date.
then there is a command button named add exercise. here is the code for
this
button.
Private Sub Add_Exercise_Click()
On Error GoTo Err_Add_Exercise_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Add Exercise"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Add_Exercise_Click:
Exit Sub

Err_Add_Exercise_Click:
MsgBox Err.Description
Resume Exit_Add_Exercise_Click

End Sub

This opens a form to add the exercise that is a combo box so i can pick
the
exercise i want to add, then fill in sets, reps weight. i am able to do
all
this but it is not client specific.

maybe i'm making this harder than it has to be?
 

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

Similar Threads


Top