Spot The SQL Mistake

Nov 24, 2004

Here's my code


Code:Dim mysql1 Dim childid As String Dim Info As String Dim inputch as string dim inputin as string inputch = "Please enter the ID number of the young person" inputin = "If you have any comments about the young person" childid = InputBox(inputch, "Add young person", "") Info = InputBox(inputin, "Comments", "") Text16.SetFocus mysql1 = "Insert into [Activity ID] (ActivityID,ID,Information) Select [Forms]![Activityinfo]![Text16].Text, childid , Info" DoCmd.RunSQL mysql1

When I run it, It does the two input boxes fine, but it then asks you for the value of childid.. ?

any help is appreciated

Paul Kent

View Replies


ADVERTISEMENT

Sorry If This Is The Wrong Spot...

Apr 12, 2005

Ok...Access newbie here..VERY newbie..

I am trying to get colum "Age Group" in table "A" to autofill based off of info from colum "Age" in table "A" AND colum "Age" in table "b" and corresponding colum "age group" in table "b"

table "b" looks like this:

Age AgeGroup
17 17-19
18 17-19
19 17-19
20 20-25
etc

I am looking for table "a" to look at the value inputted by the user in the Age colum of table a..compare it to the age colum of table b and return the correct age group in the appropriate colum of table "a"

Hope I explained myself..thanks for any help!

View 4 Replies View Related

Spot The Syntax Error

Jun 27, 2007

Hi there!

My first post here, and I'm hoping some kind soul will be able to help me (as you can tell, I'm a kinda needy type!!) :o

I've got two completely separate databases, for both of which I need to be able to print a single form at a time. No problem there, a report and a bit of code solved that - but only for one of them! This is the successful one:

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String

stDocName = "Issues"
DoCmd.OpenReport stDocName, acNormal, , "Issue_No = Forms![Concessions]!Issue_No"

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub

For my other database, I simply cut & paste the code, then changed the relevant document fields, as below:

Private Sub cmdPrint_Click()
On Error GoTo Err_cmdPrint_Click

Dim stDocName As String

stDocName = "Change Proposal Print"
DoCmd.OpenReport stDocName, acNormal, , "Issue No = Forms![Change Proposals]!Issue No"

Exit_cmdPrint_Click:
Exit Sub

Err_cmdPrint_Click:
MsgBox Err.Description
Resume Exit_cmdPrint_Click

End Sub

But when I try to run this, all I get every time is: "Syntax error (missing operator) in query expression '(Issue No = Forms![Change Proposals]!Issue No)'".

I can't for the life of me figure why one works but not the other. I've checked and treble-checked that I've got exactly the right document names. The report is "Change Proposal Print"
The form is "Change Proposals"
The form field criterion is "Issue No" (without an underscore in this one.)

What operator could possibly be missing in the second one, but not the first? Am I being very dense? Can anyone out there help? (Am I asking too many questions in a whiny voice?) :confused:

Cheers,

mike b :D

View 4 Replies View Related

Insert A Record To A Specific Spot

Aug 29, 2006

Creating a flight management database to create flightplans that determine local/zulu times and dates of each leg of the flight. Arrival and departure times are calculated by durations entered for flight time to get arrival information, and time on the ground to determine departure time/date.

My question, is there a way for the user to insert a record (leg) into an exisitng flight plan that they are editing? The legs are currently in order by an autonumber so inserting a new record would not necessarly put the legs in the correct order of the flight.

Currently, the user only needs to enter the airport identifier and air/ground time along with initial departure time/date. No dates are needed for each leg.

Thanks

View 2 Replies View Related

By Mistake

Apr 11, 2006

I am so sorry ........
By mistake, I have created another thread ........
I am sorry again ........

View 1 Replies View Related

Wireless Mistake

Mar 8, 2006

Okay I know i've been incredibily stupid and made a tremendous mistake but what i need is the best solution to the problem i have right now...
I have a database its msaccess with SQL Tables at the moment. There were an expected 40 wireless users expected but after horrendous crash on day one and only 10 users and after some digging i see that this is just not going to happen (why i assumed it would be ok is my own naivity and taking the word of the IT Manager)... the connection is totally unreliable and corrupts the database beyond repair.. infact i'd go so far as to say the wireless network murdered my database.. strong words but its my baby..

So what are my solutions here... the staff need this database... so what i have come up with are the following solutions and i thought i should ask for some advice before i plough ahead and make another fatal error..

use DAP? Or another internet based way of getting round it?

Get network points put in all the rooms?

Or can I make it totally SQLServer?

Help.. any advice would be greatly appreciated cause at the moment i have a fantastic application that just cant run and i feel such a complete failure.

View 1 Replies View Related

Mistake With Security

May 25, 2006

Guys, i need some hlp from u.
i created a db and i was testing the security options. I remove all the ticks from the check box and now i can not do anything. i cant even use the right click.

how can i recover my access? any suggestion?
thx max.

View 5 Replies View Related

Made A Mistake, Now I Need Help

Feb 8, 2005

i named one of my fields in a table with spaces "quantity on hand"

Now i cant refrence is in vba.

If rsSa!D < rsInv.Fields!"quantity on hand" Then

this does not work. I cant go back and change the field name on the table.

thanks

View 2 Replies View Related

Basic Access Mistake

Nov 3, 2005

Due to me still trying to grasp the basics of access, I have what I call the "Command Centre" which is basically a form where our administrators verify all records placed and control them from here.

As different stages of each record requires Authorising/Further Authorising by other users, they will require to update the same records as displayed on the admin control from.

The problem I have is that when the administrators make a change to a record which prompts an authoriser to go into the db and authorise, if the admin users keeps their form open (which is what I want), I understand that it doesn't save changes to the record until they exit the form. Naturally this causes problems for the authoriser.

Is there a way of saving changes to records as they are made so other users can edit the records as see it up to date. I'm thinking along the lines some vb code to save on an action.

Many thanks
kempes

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved