Display data on one form

G

Guest

Hi there lads n lasses,

I would like to display all details from one contractor on a form once i
have selected that particular contractors name from a combo box.
So...
1) Select a contractor from a combo box ie ADT
2) All details regarding that company ie Address, Phone number eyc is
diplayed on the actual form below.

The combo box gets the contractors name from another form.

Is this possible?
 
G

Guest

Here is an example of how you use a combo to display a selected record:

Private Sub cboActivity_AfterUpdate()
Dim rst As Recordset
On Error GoTo cboActivity_AfterUpdate_Error

If Not IsNull(Me.cboActivity) Then
Set rst = Me.RecordsetClone
rst.FindFirst "[Activity] = '" & Me.cboActivity & "'"
Me.Bookmark = rst.Bookmark
Set rst = Nothing
End If

cboActivity_AfterUpdate_Exit:

On Error Resume Next
Exit Sub

cboActivity_AfterUpdate_Error:

MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure cboActivity_AfterUpdate of VBA Document
Form_frmAttributetable"
GoTo cboActivity_AfterUpdate_Exit

End Sub

I don't understand the part about the combo getting it's value from another
form.
 
M

Mark M S

You could use the Combobox wizard (for us cheaters) that walks you through
selecting a field on your form like last name. Then when you select the name
the form opens that record. Where there are duplicate last names I use an
autonumber identifier to key on instead of name.

--
*************************************************
Mark M Simonian MD FAAP
Medical Director, ChildNet Medical Assoc.
681 Medical Center Drive West #106
Clovis, CA 93611
(559) 325-6850
www.markmsimonian.medem.com
****************************************
Alert: This email and any files transmitted with it
are intended solely for the use of the individual or
entity to whom they are addressed and may contain
confidential, patient health or other legally
privileged information. If you have received this
email in error please notify the sender by email,
delete and destroy this message and its attachments.
Any unauthorized review, use, disclosure,
or distribution is prohibited.
 

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