473,320 Members | 1,817 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,320 software developers and data experts.

changing data by dbcombo

5
i am trying to change the data on screen by dbcombo ... the code is below

Expand|Select|Wrap|Line Numbers
  1. Private Sub DBCombo1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  2.  Dim recSource As String
  3.    recSource = "SELECT * FROM car WHERE car_id = " & _
  4.    DBCombo1.BoundText
  5.    Data1.RecordSource = recSource
  6.    Data1.Refresh
  7. End Sub
but i dont know why i am getting ;
run time error '3061'
too few parameters. Expected 1.

and on the debug screen Data1.refresh is high lighted

thanks
Feb 14 '07 #1
1 1682
willakawill
1,646 1GB
Hi. Try this slight alteration:
Expand|Select|Wrap|Line Numbers
  1. Private Sub DBCombo1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  2.  Dim recSource As String
  3.    recSource = "SELECT * FROM car WHERE car_id = '" & _
  4.    DBCombo1.BoundText & "'"
  5.    Data1.RecordSource = recSource
  6.    Data1.Refresh
  7. End Sub
I think car_id is textual so you need the single quote marks
Feb 15 '07 #2

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

Similar topics

10
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have...
1
by: Rolln_Thndr | last post by:
I'm vey new to network programing and have a few rather fundemental questions. I'm creating a very basic UDP proxy server and having a few issues regarding the sockets. Is it possible to change...
1
by: Demetri | last post by:
Hello, I have a page with a datagrid. The datagrid has a column called Employee Name. This column is for display purposes. However, in edit mode (including making additions) the user will need...
3
by: Peter van der Veen | last post by:
Hi In my prgragm i use an API call to open the combobox when it get the focus. The code i use is this Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As...
32
by: deko | last post by:
I have a popup form with a textbox that is bound to a memo field. I've been warned about memo fields so I'm wondering if I should use this code. Is there any risk with changing the form's...
1
by: nkechifesie | last post by:
I need to lock the DbCombo text box so no one can enter anything but they can use the Drop down list. How do I go about this? I tried making the Locked property True but it disabled the Drop down...
0
by: nmn | last post by:
thank you in advance.. i am trying to retrive data to my txt fields from access tables by using dbcombo i am using DATA1 for the datasource and "car" for the table. i have no problem in...
1
by: needvb | last post by:
hi all im searching 4 a code 4 dbcombo
1
Kabyr
by: Kabyr | last post by:
Please, can someone tell me how I can use a DBCombo with a MSSQL database? I have a database, with 3 tables, Country, States, Persons. Country has CountryID (Primry), Name. State has StateID...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: 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
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.