-
DAO help
I'm just studying VB, and i have project where I have to create program to
access Aceess97 database. I'm using VB5 and Access97 and DAO method to
assess database. I
have 4 general 1 main form with tab controls on it, and by clicking tab
button certain form
would open. I also have search form, where user will look for the
particular record, and
all data associated with this record must be open in all 4 forms. Ex, RefNo
5, and
all data for this client with RefNo5 must appear in all forms.
Please, can anyone suggest and if possible show how I can use code to search
for a particular record and then show data associated with this record in
all
forms.
Any comments will be appreciated.
Thanks in advance
Vlad
-
Re: DAO help
Open a recordset with SQL string indicating what you're after...
Set db = dbengine.workspaces(0).opendatabase("c:\temp\mydb.mdb")
Set rstRecordset = db.openrecordset("Select * from tblTestTable WHERE
LastName = '" & text1.txt & "'") 'This will use the contents of a textbox
to indicate the value of the LastName field we want
if rstRecordset.recordcount <> 0 'We have a record with the lastname we want
Form1.txtLastName = rstRecordset.fields("LastName")
Form2.txtSomeStuff = rstRecordset.fields("SomeStuff")
end if
rstRecordset.close
db.close
set rstRecordset = nothing
set db = nothing
As you can see, the use of multiple tabs, forms, controls is a non-issue.
Just address what you wish to assign the field values to.
Good luck!
Larry Goldstein
Advanswers
"Vladimir Alter" <vovchik@optusnet.com.au> wrote in message
news:3bfcbfc8@147.208.176.211...
> I'm just studying VB, and i have project where I have to create program to
> access Aceess97 database. I'm using VB5 and Access97 and DAO method to
> assess database. I
> have 4 general 1 main form with tab controls on it, and by clicking tab
> button certain form
> would open. I also have search form, where user will look for the
> particular record, and
> all data associated with this record must be open in all 4 forms. Ex,
RefNo
> 5, and
> all data for this client with RefNo5 must appear in all forms.
> Please, can anyone suggest and if possible show how I can use code to
search
> for a particular record and then show data associated with this record in
> all
> forms.
> Any comments will be appreciated.
> Thanks in advance
> Vlad
>
>
>
>
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
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks