473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

SQL Insert Help

29
Hi,
i am trying to insert into a table, at run time useing a form. i am using the following line:

strSQL = "INSERT INTO [tblRequestResponse]([Request ID], [Service Offered], [Service Provider], [ServiceName], [Description], [CostPerHour]) " & _

"VALUES (froms![frmServiceProviderInfo].[lstRequest.column(0)], Forms![sbfrmServices].[ServiceID], Forms![frmServiceProviderInfo].[tblMembers_UserName], Forms![sbfrmServices].[ServiceName], Forms![sbfrmServices].[Description], Forms![sbfrmServices].[CostPerHour]);"

DoCmd.RunSQL strSQL

This is not working, and i get an eror message saying undefined function froms![frmServiceProviderInfo].[lstRequest.column(0)].

Does anyone know what the problem is.

ps. i am there is a list there, and weneva a product is doubleclicked, this should happen (insert into a table)
Apr 20 '07 #1
5 1195
MMcCarthy
14,534 Expert Mod 8TB
Hi,
i am trying to insert into a table, at run time useing a form. i am using the following line:

strSQL = "INSERT INTO [tblRequestResponse]([Request ID], [Service Offered], [Service Provider], [ServiceName], [Description], [CostPerHour]) " & _

"VALUES (froms![frmServiceProviderInfo].[lstRequest.column(0)], Forms![sbfrmServices].[ServiceID], Forms![frmServiceProviderInfo].[tblMembers_UserName], Forms![sbfrmServices].[ServiceName], Forms![sbfrmServices].[Description], Forms![sbfrmServices].[CostPerHour]);"

DoCmd.RunSQL strSQL

This is not working, and i get an eror message saying undefined function froms![frmServiceProviderInfo].[lstRequest.column(0)].

Does anyone know what the problem is.

ps. i am there is a list there, and weneva a product is doubleclicked, this should happen (insert into a table)
You have used the word Froms instead of Forms
Apr 20 '07 #2
Shokoth
29
i still get the same error.

within the main form,there is a list, a tabbed frams, and the actual form.
i am trying to insert data from a subform inside the tab control, a list box and the actual form itself.

is that possible
Apr 20 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
i still get the same error.

within the main form,there is a list, a tabbed frams, and the actual form.
i am trying to insert data from a subform inside the tab control, a list box and the actual form itself.

is that possible
Try this ...

Expand|Select|Wrap|Line Numbers
  1. Forms![frmServiceProviderInfo]!lstRequest.Column(0)
Apr 20 '07 #4
pks00
280 Expert 100+
U could try this, get the value outside the string


strSQL = "INSERT INTO [tblRequestResponse]([Request ID], [Service Offered], [Service Provider], [ServiceName], [Description], [CostPerHour]) " & _
"VALUES "( & forms!frmServiceProviderInfo!lstRequest.Column(0) & ", Forms![sbfrmServices].[ServiceID], Forms![frmServiceProviderInfo].[tblMembers_UserName], Forms![sbfrmServices].[ServiceName], Forms![sbfrmServices].[Description], Forms![sbfrmServices].[CostPerHour]);"
Apr 20 '07 #5
Shokoth
29
I tried both of these,but it stilll didint work, but i worked a way rpound it.

Created a textbox, made it invisible, and once double cliked, the value of the list.coloumn is written to that text box, and that value is then inserted.

Thanks for the help
Apr 20 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: newbie_mw | last post by:
Hi, I need urgent help with a novice problem. I would appreciate any advice, suggestions... Thanks a lot in advance! Here it is: I created a sign-up sheet (reg.html) where people fill in their...
1
by: newbie_mw | last post by:
Seems my post was buried in more cries for help :-) I will try again. It's probably a very novice question so please take a look! Thanks!...
6
by: Reply-Via-Newsgroup Thanks | last post by:
Gentle People, I think I read some where on how to do this, maybe I'm wrong. I'm working on someone elses PHP code which updates an existing database - One of the programmers used to generate...
14
by: serge | last post by:
I have a scenario where two tables are in a One-to-Many relationship and I need to move the data from the Many table to the One table so that it becomes a One-to-One relationship. I need to...
2
by: Polyhedron_12 | last post by:
I am having problems calling functions in general in VB. I keep getting alot of errors. Can anybody help me out with this? I put the error message on the same line that it says it is at. I believe...
3
by: MP | last post by:
Hi Posted this several hours ago to another ng but it never showed up thought i'd try here. using vb6, ado, .mdb, jet4.0, no access given table tblJob with field JobNumber text(10) 'The...
1
by: javedna | last post by:
Can PHP help with the following as I have tried in the MYSQL Forums and cant get any help Thanks Nabz ---------------------------------------- Hi I am developing a PHP MYSQL questionnaire...
8
by: SaltyBoat | last post by:
Needing to import and parse data from a large PDF file into an Access 2002 table: I start by converted the PDF file to a html file. Then I read this html text file, line by line, into a table...
0
by: gpspocket | last post by:
help me -CURSOR backward insert from End Date > to Start Date how to insert dates from end to start like this SELECT 111111,1,CONVERT(DATETIME, '17/03/2008', 103), CONVERT(DATETIME,...
7
by: anu b | last post by:
Hi I need to use Clr trigger for insert command My code is as below I am using SQL server 2005 and VS 2008.... but after running this code i didnt get the result as i expexted it shows the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.