[英]Access VBA code to go to a specific record on another form via selecting it in a list drop down combo box
I have a form with a combo box with a list of jobs located on a different form all with their own unique record.我有一个带有组合框的表单,其中包含位于不同表单上的工作列表,所有工作都有自己独特的记录。 I would like to be able to click the drop-down of the combo box, select a specific job and then have it open the specific job record I select... Struggling with coming up a VBA code that will do this.
我希望能够单击组合框的下拉菜单,select 一个特定的工作,然后让它打开特定的工作记录我 select...努力想出一个 Z6E3EC7E6A9F6007B48398FC0EE 代码就可以了。 Can anyone help?
任何人都可以帮忙吗? Thanks
谢谢
If you want to open another form that just shows the record selected in a combo box, then you can use the control's AfterUpdate
event, and use the "Where condition" argument of the OpenForm
action:如果要打开另一个仅显示组合框中所选记录的表单,则可以使用控件的
AfterUpdate
事件,并使用OpenForm
操作的“Where 条件”参数:
Private Sub cboSearch_AfterUpdate()
On Error GoTo E_Handle
DoCmd.OpenForm "frmData", , , "FileID=" & Me!cboSearch
sExit:
On Error Resume Next
Exit Sub
E_Handle:
MsgBox Err.Description & vbCrLf & vbCrLf & "frmSearch!cboSearch_AfterUpdate", vbOKOnly + vbCritical, "Error: " & Err.Number
Resume sExit
End Sub
Regards,问候,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.