‘No value given for one or more required parameter.’

aziz

New member
Local time
Today, 07:24
Joined
Jun 20, 2008
Messages
4
I am coding a project that connects to database, ‘chdata’ at run time. The database has two tables named ‘FamRec’ and ‘IndRec’. These tables have associated with two ADO Data Controls ‘adoFamily’ and ‘adoIndividual’. One-to-Many Relationship exits between the two tables. The FamNo joins the two tables; FamRec table is the primary table; IndRec is the secondary table. I want VB code that will enable me to display related records in the secondary table as I move through the records of the primary table. I try to select all fields from IndRec table where ‘FamNo’ field in IndRec equals ‘FamNo’ in FamRec with the SQL select statement shown below. But when I run the project it generates the above error statement. Any help will be greatly appreciated.


Dim CS As String
Dim SQLQ As String
Dim SQLQFAM As String

CS = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;" & _
"Data Source=" & App.Path & "\chdata.mdb"
adoFamily.ConnectionString = CS
SQLQFAM = "SELECT * FROM FAMREC"
adoFamily.RecordSource = SQLQFAM
adoFamily.Refresh

adoIndividual.ConnectionString = CS
SQLQ = "SELECT * FROM INDREC WHERE INDREC.FAMNO=FAMREC.FAMNO"
adoIndividual.RecordSource = SQLQ
adoIndividual.Refresh
 
App.Path

It is set to the current application directory at run time in the
Form_LOad () event as shown by the code below


CS = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;" & _
"Data Source=" & App.Path & "\chdata.mdb"
 

Users who are viewing this thread

Back
Top Bottom