Current field = subform field?

Glue

Registered User.
Local time
Today, 12:29
Joined
Jul 11, 2012
Messages
16
I have a Form: Orders
With a subform: OrdersSubformOrderItems

I have created a third form: JobNoSearchF

When the user enter the last four or five digits of a job number on an unbound text box located on the subform and clicks the search command button the JobNoSearchF forms opens up and displays the job information. So far so good!!!

I have added a command button "Select" on the JobNoSearchF to add the located job back into a different field in the Subform.

I’ve tried this OnClick event five thousand ways and received just as many error msgs… with the below code I get “object required”
Any help would be greatly appreciated:

Private Sub cmdSelect_Click()
On Error GoTo Err_cmdSelect_Click

Me![JobID] = OrdersSubformOrderItems.Form!JobID

Exit_cmdSelect_Click:
Exit Sub

Err_cmdSelect_Click:
MsgBox Err.Description
Resume Exit_cmdSelect_Click

End Sub

Thanks again to anyone you may have a solution...
 
Check this link for the correct Syntax for referring to Forms and subforms from various relative locations.
 
Thank you, I think you were refering to the "refer to Form and Subform properties and controls" Page. Sorry I can't post links yet!!!

I spent some time and think it should be working with this:

Me!JobID = Forms!Orders!OrderItems.Form!JobID

It is now giving me the errror "You can't assign a value to this object" (it is an Autonumber)

Maybe there is another work around? The combobox with Job ID is listed by JobName then JobNumber. Often our guys only know the project by the number (at least the last four digits: 10-12-1515 or five digits: WO-56151.) I need them to quickly be able to find and populate the JobID Field. My solution was to build a query that has the criteria Right([JobID, 4]) or Right([JobID,5]) equal to the unbound text box and have a popup form to show the results.

that works fine for them to find the jobName if they don't know it, but don't want them to have to change fields and then scroll through all the projects to find the job. I'd really like to automate it.

Any suggestions?
 

Users who are viewing this thread

Back
Top Bottom