473,320 Members | 2,080 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.

Access VB table/form connection question

1
I'm trying to create a query that will pull information out of a table and back into the original Submit Data form for editing purposes.

I have have a FrmSubmit to enter data into tblMaster. I have a second form with two buttons that are suppose to queue up a new blank FrmSubmit for button 1, and a searchbox to search, pull, and edit previously entered information from tblMaster into the FrmSubmit with button 2.

This is the code I have to populate a new blank FrmSubmit through button1:

Private Sub Cmd1_Click()
Dim sql As String
sql = "Select* from tblMaster"
DoCmd.OpenForm "FrmSubmit", acNormal
Forms![FrmSubmit].RecordSource = sql
Forms![FrmSubmit].Refresh
DoCmd.GoToRecord acDataForm, "FrmSubmit", acNewRec
End Sub

This code works fine. The following is the code I have to pull data from tblMaster into a FrmSubmit for editing through button2:

Private Sub Command1_Click()
Dim sql As String, inp As String
inp = InputBox("Enter Promotion Name for record to edit")
sql = "Select* from tblMaster where Promotion ='" & inp & "'"
DoCmd.OpenForm "FrmSubmit", acNormal
Forms![FrmSubmit].RecordSource = sql
Forms![FrmSubmit].Refresh
End Sub

This will allow the search box to come up to search by one of the fields in the table,'Promotion,' but it won't populate the table after the search. It just returns a blank table.

This is my first VB project ever, so I apologize if the information I provided is confusing at all. I'm flying by the seat of my pants, here. Please let me know if you can help, and thank you in advance.

-Erin
Jun 27 '07 #1
0 1248

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

Similar topics

28
by: Lee Rouse | last post by:
Hello all, This is going to be a rather lengthy "question". I have an Access 2k database, separated front end/back end. Front end copies are on about 30 workstations and used frequently during...
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
7
by: smd | last post by:
Hello and thanks for taking the time to read this. I've looked all over the web and newsgroups and can't find a solution to my problem. I've posted this question to the Access 2000 group as well -...
16
by: Mr. B | last post by:
VB.net 2003; MS Access db; Netframe 1.1 I wrote an Windows app for my last place of employment that opened and modified a couple of MS Access db files. I did most of my programming at home on...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
3
by: blue875 | last post by:
Ok, I've tried searching, and haven't found the answer, so it must mean everyone else but me already knows this. I have an Access 2000 form that I want to connect to an Access 2000 table in the...
2
by: weiwei | last post by:
Hi, I have a question regarding data access, here is my scenario, when a user create username, that username is check against username table, if new request username is existed already, then...
8
by: mark_aok | last post by:
Hi all, I have a split database. Both the forms, and the tables are stored on a shared network drive (this is Access 2003). The users use the forms, and the tables on the network drive, there...
24
by: jerrydigital | last post by:
Hello, I am new to this forum but have read several posts and I thank you for your great assistance. I am stumped right now. I have a user registration form in asp that is set to a form...
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
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: 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: 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: 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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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.