If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
On Cick Code needed!
I have created a dropdown combo list box (cbOwnerMain) now I want it to open the owners record form when I click on his name, the form name that the owners appear on is (FrmOwnerInfo) and the Query is (qryOwnerInfo), I suppose something on click event! Thanks in advance.........Bob Vance |
#2
|
|||
|
|||
On Cick Code needed!
If you code at all, check Help on the DoCmd.OpenForm statement and that will
likely be all you need. If you do not, post back with the name of the owner's name key Field in the Query for the Form you want to open and someone can likely give you the code you need to use in the AfterUpdate event of cbOwnerMain. Larry Linson Microsoft Access MVP "Bob" wrote in message ... I have created a dropdown combo list box (cbOwnerMain) now I want it to open the owners record form when I click on his name, the form name that the owners appear on is (FrmOwnerInfo) and the Query is (qryOwnerInfo), I suppose something on click event! Thanks in advance.........Bob Vance |
#3
|
|||
|
|||
On Cick Code needed!
This is Sql code in qryOwnerInfo:
SELECT tblOwnerInfo.OwnerID, IIf(IsNull(tblOwnerInfo.OwnerLastName),'',tblOwner Info.OwnerLastName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerFirstName),'',tblOwne rInfo.OwnerFirstName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerTitle),'',tblOwnerInf o.OwnerTitle) AS Name FROM tblOwnerInfo WHERE (((tblOwnerInfo.Status)='Active')) ORDER BY IIf(IsNull(tblOwnerInfo.OwnerLastName),'',tblOwner Info.OwnerLastName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerFirstName),'',tblOwne rInfo.OwnerFirstName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerTitle),'',tblOwnerInf o.OwnerTitle); Thanks Bob |
#4
|
|||
|
|||
On Cick Code needed!
Got it:
Private Sub cbOwner_AfterUpdate() DoCmd.OpenForm "frmOwnerInfo", , , "OwnerID=" & val(cbOwner.value) End Sub Thanks for your help...Bob "Bob" wrote in message ... This is Sql code in qryOwnerInfo: SELECT tblOwnerInfo.OwnerID, IIf(IsNull(tblOwnerInfo.OwnerLastName),'',tblOwner Info.OwnerLastName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerFirstName),'',tblOwne rInfo.OwnerFirstName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerTitle),'',tblOwnerInf o.OwnerTitle) AS Name FROM tblOwnerInfo WHERE (((tblOwnerInfo.Status)='Active')) ORDER BY IIf(IsNull(tblOwnerInfo.OwnerLastName),'',tblOwner Info.OwnerLastName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerFirstName),'',tblOwne rInfo.OwnerFirstName & ' ') & IIf(IsNull(tblOwnerInfo.OwnerTitle),'',tblOwnerInf o.OwnerTitle); Thanks Bob |
#5
|
|||
|
|||
On Cick Code needed!
"Bob" wrote in message ...
Got it: Private Sub cbOwner_AfterUpdate() DoCmd.OpenForm "frmOwnerInfo", , , "OwnerID=" & val(cbOwner.value) End Sub Thanks for your help...Bob This line should work just as well: DoCmd.OpenForm "frmOwnerInfo", , , "OwnerID=" & cbOwner The Val() function returns the numbers from a string and there shouldn't be a string in most ID fields. The .value property is the default property of data controls, so it's unnecessary to use it. -- Arvin Meyer, MCP, MVP Free MS-Access downloads: http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com |
Thread Tools | |
Display Modes | |
|
|