[Help] - About Tables And Data

Lol ha sorry i jsut read your post before i posted like 6..

hmm i can use quiery's but i dotn want to complicate what i have got and with only 3 hours left.. i dunno what im gunna do and to get the quiery's to work and input all the data will probablly take me longer than 3 hours..

so im just gonig to stick with the VBA and SQL and get that to work by half 1

and then i can go ahead and input the data and most probably not finish that by 4 and i can just tell them where to go from there..

so ye thanks for all the help and such but i just need the VBA - SQL stuff to work thanks alot too and sorry for not takingon board your idea of quiery's lol..
maybe if i had more time i can start the database from scratch again and lsiten to your advice and follow through with normalisation and quiery's ect..
 
Ok Finally Got It too Work :D

Half Past 1 Ha Oh Yes! Im Perfect Lol :D

anyways still a little problem..
here is my coding..
Code:
Private Sub Form_AfterInsert()

    Dim SQL As String
    Dim SQL1 As String
    Dim SQL2 As String
    Dim SQL3 As String
    Dim SQL4 As String
    Dim SQL5 As String
    Dim SQL6 As String
    Dim SQL7 As String
    Dim SQL8 As String
    Dim SQL9 As String
    Dim SQL10 As String
    Dim SQL11 As String
    Dim SQL12 As String

SQL = "INSERT INTO availability (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL1 = "INSERT INTO caseworkers (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL2 = "INSERT INTO Employment (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL3 = "INSERT INTO Generalist_Adviser (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL4 = "INSERT INTO NHAS (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL5 = "INSERT INTO Other (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL6 = "INSERT INTO Specialist_CPD (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL7 = "INSERT INTO Telephone_Advice (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL8 = "INSERT INTO Generalist_Advice (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL9 = "INSERT INTO Trainee_Adviser (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL10 = "INSERT INTO Trainees (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL11 = "INSERT INTO W_A_Caseworker_CPD (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL12 = "INSERT INTO W_A_Generalist_CPD (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

DoCmd.RunSQL SQL
DoCmd.RunSQL SQL1
DoCmd.RunSQL SQL2
DoCmd.RunSQL SQL3
DoCmd.RunSQL SQL4
DoCmd.RunSQL SQL5
DoCmd.RunSQL SQL6
DoCmd.RunSQL SQL7
DoCmd.RunSQL SQL8
DoCmd.RunSQL SQL9
DoCmd.RunSQL SQL10
DoCmd.RunSQL SQL11
DoCmd.RunSQL SQL12

End Sub

From SQL9 onwards it wont update the tables.. :S maybe im doing something wrong?? it seems all perfect as i just copied and pasted most of it and changed the table names..
:S

Please Help i Need A Quick Answer As soon As possible :D

Need to start entering the data :d

thanks For All Yuor help

- Alan
 
Can't see anything wrong. Check the spelling of your tables names including capitalisation are the same. Also check the spelling of your field names in the tables themselves. Make sure you don't have queries with the same names as your tables.
 
ahh Ok Thanks I will check This Now =] Thanks For All The Help!!

I Could Kiss You lol :D

Next Part adding The 1000 Records.. :| Im Going to Waste Time and Just Add Like 10 =] :D

Not My Fault If They Are Too Lazy.. =l

- Alan
 
AHH 1 Hour And 30 Minutes.. Never Going To get This Done.. I Have Checked The Queiry's and Tables.. Capitals Spelling Everything.. Not Seeming To Work.. it Is As If The Pc Doesnt Want Me to Complete The Database.. :l =[ Poor Me 2 Weeks And Their Orginal Database Is Better Than Mine :| Grr

Hmm Trying To See Wheither There Is Alimit On SQL Queiry's there Shouldn't Be..

Hmm Ill Just Tell My Tutor That Its Not Perfect And Needs A Lil Work =] Or Just Not Tell Them And Never Show Up At Work Again Ha

Oh Well wish me Luck For The Next Hour And A Half (y)

- Alan
 
I don't think there's a limit. Try deleting 1 to 8 from your code and just run 9 to 12.
 
Ahh good Idea =]

commenting is // ??

yes i dont want to delete just incase =P
 
haha there must be something wrong.. Hmm cant find the error Grr

thanks for the trouble shooting lol would have never thought of that.. =P

Hmm Any Idea?? There Must Be A speeling Mistake somewhere Along The Lines hmm Lets Look And Find Out =]

- Alan
 
Hmm there must be a limit because i commented all of them off up too 9 and tested it didnt work.. then i commented off 9 and 10 and 1 2 3 4 5 6 7 and 8 and it worked.. so i thought it was 9 and 10.. so i un commented them all and commented 9 and 10 and it didnt work.. so i commented off 9, 10 and 11 still didnt work.. so i have no idea ehats wrong.. any idea's?

- Alan
 
I would delete, not comment out. You've posted the code here so you can copy and paste it back.
 
Lol how stupid.. found out the problem.. :D
SQL8 has been copied so it stops at that point so i dleeted SQL8 and works fine =]

Woo lol :D
 
haha i lie.. :S
Code:
Private Sub Form_AfterInsert()

    Dim SQL As String
    Dim SQL1 As String
    Dim SQL2 As String
    Dim SQL3 As String
    Dim SQL4 As String
    Dim SQL5 As String
    Dim SQL6 As String
    Dim SQL7 As String
    Dim SQL8 As String
    Dim SQL9 As String
    Dim SQL10 As String
    Dim SQL11 As String

SQL = "INSERT INTO availability (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL1 = "INSERT INTO caseworkers (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL2 = "INSERT INTO Employment (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL3 = "INSERT INTO Generalist_Adviser (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL4 = "INSERT INTO NHAS (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL5 = "INSERT INTO Other (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL6 = "INSERT INTO Specialist_CPD (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL7 = "INSERT INTO Telephone_Advice (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL8 = "INSERT INTO Trainee_Adviser (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL9 = "INSERT INTO Trainees (ID, Staff_ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Staff_ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL10 = "INSERT INTO W_A_Caseworker_CPD (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

SQL11 = "INSERT INTO W_A_Generalist_CPD (ID, Title, Name, Surname) " & _
"VALUES ([ID].Value, [Title].Value, [Name1].Value, [Surname].Value)"

DoCmd.RunSQL SQL
DoCmd.RunSQL SQL1
DoCmd.RunSQL SQL2
DoCmd.RunSQL SQL3
DoCmd.RunSQL SQL4
DoCmd.RunSQL SQL5
DoCmd.RunSQL SQL6
DoCmd.RunSQL SQL7
DoCmd.RunSQL SQL8
DoCmd.RunSQL SQL9
DoCmd.RunSQL SQL10
DoCmd.RunSQL SQL11

End Sub

see any problem it stops at SQL8 again for soem reason Hmm if you have a look i have moved the numbers up 1 :D so its not copied..
 
Hmm .. Its Just SQL9 for soem reason.. =P The Main One Too Be Percise lol Hmm Can You See Anything Wrong? Im gonig to check The Tables Just Incasr I Missed Something..
 
Yep It Was In The Table.. :P didnt Have The Feild Called 'Title' How Silly =]

Well Works Fine.. :D

Now 40 Minutes Left Ill Start Um.. Adding In Records.. =]
Yay :D

Thanks For all your Lovely Help =]

I Think i Will stay On This Forum Just Incase I Need Help With Access again =] 2 Weeks And I Have Learnt Alot! =]

- Alan
 
Pleased you got it working.

And perhaps you can check out your basic design before you commit the next database crime!
 
Lol Yes!.. =] Im Well Chuffed First Database I Have Made LOL :rolleyes: Hope My Company Likes It Or They Can Just Get Somebody Experienced LOL Ha Im gonig to Go Back To College They Will Have Me Make A Presentation Of what I Did And I Am Going to Say.. I Cant Its Classified =] Ha Well Thanks And Yes The Next Dataabse Hope there Will Never Be One! =] Unless Its To Do With PHP MySql Website Development =] That Way Its Much Easier.. =]

Thanks Alot

- Alan
 

Users who are viewing this thread

Back
Top Bottom