Am I normalized?

  • Thread starter Thread starter JackP
  • Start date Start date
J

JackP

Quick lay of the land...

Table 1 (Banking) Final resting place for all transactions
Layout
[Date], [Source], [CurrencyType], [Amount]. Source is pulled from the
tblSource with fields like "Till 1 in", "Till 1 Out", "Bank In", "Bank Out"
etc.
and Currency from tblCurrency with fields like "Hundreds", "Fiftys",
"Twentys" etc.

Table 2 (TillOut)
This has 5 records in it for the different Till types we use. I have a form
that the user can select the Till Type from a cbo.
"Till Type", "Hundreds", "Fiftys", "Twentys" etc.

On that form, I am also pulling the different Sources

What I need to do next is put all that together and add new records to Table
1 like this...

' Insert Hundreds
[Date] =now()
[Source] = [from cbo on form]
[CurrencyType] = [form.Hundreds]
[Amount]=[Form.HundredsAmount}]

Next Record

' Insert Fiftys
Date] =now()
[Source] = [from cbo on form]
[CurrencyType] = [form.Fiftys] <--- notice the change from above.
[Amount]=[Form.FiftysAmount}]

Next Record

' Insert Twentys
Date] =now()
[Source] = [from cbo on form]
[CurrencyType] = [form.Twentys] <--- notice the change from above.
[Amount]=[Form.TwentysAmount}]

So... my question. Am I on the wrong path as far as normalization... I
don't think so. If not, How can I do this?

Thanks,
Jack
 
Thanks for the reply...

I do have the identified in my tables and I _believe_ that I am "ok" with
normalization.

The second part of my question was in reference to inserting data from a
form. I am heading down the path and I am hung up on something. Below is my
code. I am getting a type mismatch on the Me!Hundreds line.

Any ideas?



Dim strSQL As String


strSQL = "Insert Into CM_Banking ([CMSource],[CMBillType],[Amount])"
strSQL = strSQL + " VALUES ("
strSQL = strSQL + Me!Combo32
strSQL = strSQL + ", "
strSQL = strSQL + "Hundred"
strSQL = strSQL + ", "
strSQL = strSQL + Me!Hundreds
strSQL = strSQL + ");"

MsgBox strSQL
DoCmd.RunSQL strSQL
 
NeverYouMind.... I fingered it out



Dim strSQL As String
MsgBox Me!Hundreds

strSQL = "Insert Into CM_Banking ([CMSource],[CMBillType],[Amount])"
strSQL = strSQL + " VALUES ("
strSQL = strSQL + Me!Combo32
strSQL = strSQL + ", 13, " & Me!Hundreds
strSQL = strSQL + ");"

MsgBox strSQL
DoCmd.RunSQL strSQL


JackP said:
Thanks for the reply...

I do have the identified in my tables and I _believe_ that I am "ok" with
normalization.

The second part of my question was in reference to inserting data from a
form. I am heading down the path and I am hung up on something. Below is my
code. I am getting a type mismatch on the Me!Hundreds line.

Any ideas?



Dim strSQL As String


strSQL = "Insert Into CM_Banking ([CMSource],[CMBillType],[Amount])"
strSQL = strSQL + " VALUES ("
strSQL = strSQL + Me!Combo32
strSQL = strSQL + ", "
strSQL = strSQL + "Hundred"
strSQL = strSQL + ", "
strSQL = strSQL + Me!Hundreds
strSQL = strSQL + ");"

MsgBox strSQL
DoCmd.RunSQL strSQL




TC said:
You haven't identified the primary keys of your tables! Primary keys are a
fundamental part of normalization. So - with respect - the chances of your
tables being properly normalized, are low, IMO.

Perhaps read this:
http://support.microsoft.com/support/kb/articles/Q100139.ASP

HTH,
TC
(off for 2 days)
 
Back
Top