View Single Post
  #1 (permalink)  
Old February 28th, 2005, 05:04 PM
marcin2k marcin2k is offline
Authorized User
Points: 174, Level: 3
Points: 174, Level: 3 Points: 174, Level: 3 Points: 174, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: , , .
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default Display data in a subform

I have two tables:
tCon: tTrans:
ConID TransID
EnvNo EnvNo
Name Money
Desc

Basically its a form(works on tTrans) with a subform(works on tCon) in it and what I need it to do is when I type in a EnvNo, after I lose focus with it I need it to display below, where the subform is the informaiton for that EnvNo account(displays Name and desc). How can I go about display that. Here is what I have but I am not sure how to send the id so that it can be displayed in the subform which is part of my main form.

Private Sub txtEnvNo_LostFocus()
On Error GoTo errhandler
    Dim strConId As String
    If txtEnvNo.Text <> "" Then
        intEnvNo = txtEnvNo.Text
        strConId = DLookup("[ConID]", "tCon", "[EnvNo]=" & intEnvNo)
    Else
        MsgBox "Please input a EnvNo"
    End If
Exit Sub
errhandler:
    MsgBox "Record does not exist"
End Sub




Reply With Quote