N
Nadine via AccessMonster.com
Hi!
First of all - I want to say how much this website has helped me to date. I
am a beginner to ACCESS and use this site to help me learn.
I believe I have a problem which is not that complicated to the experts and
was hoping to get some help. Thank you in advance to anyone who replies to
this thread.
I have a form with two text boxes for the user to input values. I want to
use these values to SELECT data from a table.
Here is my attempt and am falling short as to how to proceed:
****************************************************************************************************
- - I decided to go with a recordset but am not sure if this is the best
choice. - -
Dim db As Database
Dim rec As Recordset
Dim SQLString As String
strCertificate = txtCertificate
strCrop = txtCrop
SQLString = "SELECT Contract, PLAN, AIY, Price_05, Area, Cvg_05 " & _
"FROM dat_AllPlans " & _
"WHERE Certificate = " & strCertificate & " AND CROP = " &
strCrop & ""
Set db = CurrentDb()
Set rec = db.OpenRecordset(SQLString)
- - This is where I am lost - -
********************************************************************************************************
How do I assign variables based on what the SELECT statement brings back? I
have six textboxes on the form that I want to display information for
(Contract, PLAN, AIY, Price_05, Area, Cvg_05) based on the Certificate and
Crop information entered by the user.
I hope someone is able to understand my problem!
Thank you!
Nadine
First of all - I want to say how much this website has helped me to date. I
am a beginner to ACCESS and use this site to help me learn.
I believe I have a problem which is not that complicated to the experts and
was hoping to get some help. Thank you in advance to anyone who replies to
this thread.
I have a form with two text boxes for the user to input values. I want to
use these values to SELECT data from a table.
Here is my attempt and am falling short as to how to proceed:
****************************************************************************************************
- - I decided to go with a recordset but am not sure if this is the best
choice. - -
Dim db As Database
Dim rec As Recordset
Dim SQLString As String
strCertificate = txtCertificate
strCrop = txtCrop
SQLString = "SELECT Contract, PLAN, AIY, Price_05, Area, Cvg_05 " & _
"FROM dat_AllPlans " & _
"WHERE Certificate = " & strCertificate & " AND CROP = " &
strCrop & ""
Set db = CurrentDb()
Set rec = db.OpenRecordset(SQLString)
- - This is where I am lost - -
********************************************************************************************************
How do I assign variables based on what the SELECT statement brings back? I
have six textboxes on the form that I want to display information for
(Contract, PLAN, AIY, Price_05, Area, Cvg_05) based on the Certificate and
Crop information entered by the user.
I hope someone is able to understand my problem!
Thank you!
Nadine