Welcome to Dream.In.Code
Getting VB Help is Easy!

Join 136,459 VB Programmers for FREE! Get instant access to thousands of VB experts, tutorials, code snippets, and more! There are 1,806 people online right now. Registration is fast and FREE... Join Now!




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

 
Reply to this topicStart new topic

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

paulaziz
30 Jul, 2008 - 04:37 AM
Post #1

New D.I.C Head
*

Joined: 24 Mar, 2008
Posts: 1

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.

CODE

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

User is offlineProfile CardPM
+Quote Post

Zhalix
RE: ‘No Value Given For One Or More Required Parameter.’
30 Jul, 2008 - 04:39 AM
Post #2

D.I.C Head
**

Joined: 7 May, 2008
Posts: 218



Thanked: 9 times
My Contributions
I've never worked with databases so I cannot give you any specifics, but you're missing a parameter in the line that it highlights yellow when you press "debug".
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 04:08PM

Live VB Help!

VB Tutorials

Reference Sheets

VB Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month