on visiible Form show another forms current revision number

B

Billp

Hi,

I have a form which I wish to be able to display in a control on it, another
forms current revision number.
Works form can have a Packingslip form raised against it, the two froms are
related by the WorksNumber. The Works Card is open I would like to view the
current Packing slips field called revision. I have tried to use a sub form
with the packslip revision only showing and then relating this to the Works
card - didn't work. I thought of trying an uncontrolled text box but couldn't
work out how to link it to the Packing slip form number and the subfield
Packing slip revision. If I write a simple query based on the Pacaking slip I
can get the revision to show if I enter the Works Number as a criteria - but
I am lost as to how to implement this on the current Works Form.
Help would be appreciated - guidance apprecaited.
Thanks
Bill
 
T

Tom Wickerath

Hi Bill,

Try something like this, as the Control Source for a text box:

General Syntax:
=[Forms]![NameOfForm]![NameOfControl]

In your case, this might be:
=[Forms]![Packingslip]![revision]

or perhaps
=[Forms]![Packingslip form]![revision]

Note: In order for this to work, the Packingslip form must be open.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
B

Billp

Thank you Tom,

Your reply and idea prompted me to have a flash of inspiration.
I created an unbound text box and then placed in the "On Current" of the
form the following
Dim db As DAO.Database
Dim rstp As DAO.Recordset
Set db = CurrentDb
Set rstp = db.OpenRecordset("tblPackingSlip", dbOpenDynaset)
rstp.FindFirst "Works_Number = """ & Me!txtWorks_Number & """"
If rstp.NoMatch Then
'do nothing
Else
Me!txtPackingSlipRevision = rstp!Packing_Slip
End If

Set the default value of the unbound text box to zero.
So when the works form is current it looks up the tblPacking slip to see if
there are any packing slips linked to that number - if so then the recordset
value of the revision becomes the value of the unbound text box.

wahooooooooooooooooooooooooooooooooooooooooooooooooo

Cheers
Bill

Tom Wickerath said:
Hi Bill,

Try something like this, as the Control Source for a text box:

General Syntax:
=[Forms]![NameOfForm]![NameOfControl]

In your case, this might be:
=[Forms]![Packingslip]![revision]

or perhaps
=[Forms]![Packingslip form]![revision]

Note: In order for this to work, the Packingslip form must be open.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

Billp said:
Hi,

I have a form which I wish to be able to display in a control on it, another
forms current revision number.
Works form can have a Packingslip form raised against it, the two froms are
related by the WorksNumber. The Works Card is open I would like to view the
current Packing slips field called revision. I have tried to use a sub form
with the packslip revision only showing and then relating this to the Works
card - didn't work. I thought of trying an uncontrolled text box but couldn't
work out how to link it to the Packing slip form number and the subfield
Packing slip revision. If I write a simple query based on the Pacaking slip I
can get the revision to show if I enter the Works Number as a criteria - but
I am lost as to how to implement this on the current Works Form.
Help would be appreciated - guidance apprecaited.
Thanks
Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top