Vyldryn
asked on
data linked forms
Hi. I'm trying to write a database program in VB. However, there is one form which cannot hold all the information on it at the same time, so I created a second form to hold the rest of the info. The problem is that on the first form, there is a data control which is used to scroll through the different records. How do I make it so that when I scroll, the information on the second form also scrolls with it (i.e. if i bring up the second form, the info on the second form will match the record displaying on the first)?
I tried doing the following, but it's giving me an error, "Invalid use of null". Can someone help me fix this please?
txtPayment.DataField = txtEnterInvoices.dbFairban x.Recordse t.Fields(" PYMNTRCVD" )
txtPaymentDate.DataField = frmEnterInvoices.dbFairban x.Recordse t.Fields(" PYMNTDATE" )
-Vyl
I tried doing the following, but it's giving me an error, "Invalid use of null". Can someone help me fix this please?
txtPayment.DataField = txtEnterInvoices.dbFairban
txtPaymentDate.DataField = frmEnterInvoices.dbFairban
-Vyl
You can put a second Data Control on form2, and...
Set form2.dCtrl = form1.dCtrl
Also, you get Invalid Use of Null because you're trying to assign the default value of the Field object to the Datafield of the textbox. The default value is Value (ie what's in the field).
txtPaymentDate.DataField = "PYMNTDATE"
Incidentally, you can get round Invalid Use of Null when trying to put a Null field into something by adding an empty string:
(field) = (nullvalue) & ""
Set form2.dCtrl = form1.dCtrl
Also, you get Invalid Use of Null because you're trying to assign the default value of the Field object to the Datafield of the textbox. The default value is Value (ie what's in the field).
txtPaymentDate.DataField = "PYMNTDATE"
Incidentally, you can get round Invalid Use of Null when trying to put a Null field into something by adding an empty string:
(field) = (nullvalue) & ""
ASKER
I will try this...but I can't seem to find the Common Controls reference in my reference list. What is it called in the references list?
- Vyl
- Vyl
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're identification could be anything unique such as what you are using as your primary key in the table.
ASKER
wow, great help, thanks! it does exactly what I needed it to do.
The accepted answer is not the most efficient.
I haven't solved the problem you asked about, but I never use bound controls.
Good luck.