|
-
Aug 2nd, 2000, 01:52 PM
#1
Thread Starter
Hyperactive Member
Hi,
I want to do something very simple, but cannot get it working.
I have an MS Access database "Contacs", Table "Friends" with fields "Name" and "surname" and a form with textboxes "txtname" and "txtsurname" and an update command button.
All I want to do is add names and surnames entered into the textboxes into the table (friends) when the user click the update button ie.
insert into friends values (txtname.text,txtsurname.text).
Why does this not work???? It works fine when I hardcode the fields ie.
insert into friends values ("Dan","Abercrombie").
-
Aug 2nd, 2000, 02:43 PM
#2
Frenzied Member
Your variables need to be wrapped in quotes, Give this a shot:
sSQL = "insert into friends values ('" & txtname.text & "','" & txtsurname.text & "')"
-
Aug 2nd, 2000, 02:49 PM
#3
Thread Starter
Hyperactive Member
Thank you very much!!! You wont believe this, but I could not find any help in any of my books (teach yourself by Sams) on this problem I had.
-
Aug 2nd, 2000, 03:03 PM
#4
Lively Member
Can you explain your problems more specifically? does your program have database object in the form? Maybe the problem your having is due to the unlinked text boxes. For your text boxes properties, you might want to declare datasource and datamember. then for command click botton, just write:
datMydatabasename.recordset.addnew
if you have more problems, email me at [email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|