Question : Need help designing feature to display info in textbox

I need help designing a procedure to fill in a text box based on another textbox...

Answer : Need help designing feature to display info in textbox

There are a number of ways you could display the JobName associated with the job number.

1.  As you mentioned, you could use a popup form, but this could be annoying
2.  You could add another textbox in the forms footer to display it, but if it is long, you would have to modify the layout.
3.  Another way to do it, without taking up any screen realestate is to use the syscmd method to dispaly some text in the status bar at the bottom left of the Access window.  Something like:

Private Sub txt_JobNumber_BeforeUpdate(Cancel as integer)

    Dim varJobName as Variant
   
    strCriteria = "[JobNumber] = " & me.JobNumber
    varJobName = Dlookup("[JobName], "tblJobs", strCriteria)

    if isnull(varJobName) then
        msgbox "Invalide job number"
        Cancel = true
    end if

    syscmd acSysCmdsetstatus, NZ(varJobName, "Invalid job Number")

End Sub
Random Solutions  
 
programming4us programming4us