HELP: Master details form 
Author Message
 HELP: Master details form

Help!

I'm tryig to assess the database capabilities of VB for smallish db
applications.  I've got vb Enterprise edition, and I've read through the
books on line, but I can't get what should be a simple thing to work.

I've got two tables, dept(dept_id, deptName), and emp(emp_id, dept_id,
empName).

I created a form with two data controls, one for each table, and on the
reposition method for the dept data control I want to set the emp data
control recordsource to be the sql statement: select name from emp where
dept_id=<dept_id of currently displayed dept recordset> so that I can
display all the emp records with that dept_id.  I can build the  sql
statement ok, and set the emp data control's recordsource to the sql
statement, but when I do the refresh I get an error 3061 telling me I
need 1 argument.

HELP!! I can't see what I've done wrong.

Anyone got a simple master detail form they can send me or point at a
source online??

Many many thanks in advance (my manager will also thank you and stop
hassling me).

Lachlan Williams
Snr Analyst Programmer - IT Systems
Minenco Pty Limited


voice: +61 3 9695 4234 (work)
snail: 111 Coventry Street, South Melbourne,
Victoria, AUSTRALIA 3205



Tue, 23 Mar 1999 03:00:00 GMT  
 HELP: Master details form

Hi Lachlan,

The following example assumes that text1 holds the [dept_id]

Note the single and double quotes in the SQL string:

MySQL =  "select name from emp where dept_id=< ' " &  text1 & " ' "
text2 = MySQL     ' for debugging only

The best way that I've found to debug this sort of thing is to place
an extra text box on your form and print the SQL string to it. You
will have to set the textbox's multiline property yo true.

It should look like this:

select name from emp where dept_id=< 'ABC123 '

If it doesn't look like the above example, you probably messed up the
quotation marks.

Let me know if my explanation wasn't clear.

        Don

On Fri, 04 Oct 1996 21:22:00 +1100, Lachlan Williams

Quote:

>Help!

>I'm tryig to assess the database capabilities of VB for smallish db
>applications.  I've got vb Enterprise edition, and I've read through the
>books on line, but I can't get what should be a simple thing to work.

>I've got two tables, dept(dept_id, deptName), and emp(emp_id, dept_id,
>empName).

>I created a form with two data controls, one for each table, and on the
>reposition method for the dept data control I want to set the emp data
>control recordsource to be the sql statement: select name from emp where
>dept_id=<dept_id of currently displayed dept recordset> so that I can
>display all the emp records with that dept_id.  I can build the  sql
>statement ok, and set the emp data control's recordsource to the sql
>statement, but when I do the refresh I get an error 3061 telling me I
>need 1 argument.

>HELP!! I can't see what I've done wrong.

>Anyone got a simple master detail form they can send me or point at a
>source online??

>Many many thanks in advance (my manager will also thank you and stop
>hassling me).

>Lachlan Williams
>Snr Analyst Programmer - IT Systems
>Minenco Pty Limited


>voice: +61 3 9695 4234 (work)
>snail: 111 Coventry Street, South Melbourne,
>Victoria, AUSTRALIA 3205

Don Krouse

Everett, WA, USA


Thu, 25 Mar 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Master-Detail with 2 seperate detail sections per master record, CR.NET

2. Link multiple datagrids to a single record (Master\Detail Form with multiple details)

3. Data Form Wizard with Master/Detail Form-Layout

4. Inserting detail rows in master-detail configuration (VB4)

5. Q Master-Detail forms

6. VB6.0 Wizard generated master/detail forms give huge problems

7. Facing Problems in DBGrid Control in Master Detail Forms

8. Master Detail Form in RDO

9. Master Detail form using Visual Basic

10. VB Forms Master/Details

11. Master/detail form

12. Master / detail form

 

 
Powered by phpBB® Forum Software