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
|
|||
|
|||
OpenForm command
I have an unbound textbox on my main switchboard named
OrderLookUp. I have the AfterUpdate event set to a macro called OrderLookUp, which has the action OpenForm, Form Name is Orders, Where Condition is [Forms]![Orders]! [OrderID]=[Forms]![Main Switchboard]![OrderLookUp]. However, when I enter a value into OrderLookUp, it runs the macro and opens the form called Orders, but it's a blank form, even though the value I entered definetely corresponds to a value on the form Orders. Basically, I want to be able to enter an order number on the main switchboard, hit enter, and have the database open the order form to that particular order. What am I doing wrong? Thanks. |
#2
|
|||
|
|||
OpenForm command
"Dan Cole" wrote in message
... Where Condition is [Forms]![Orders]! [OrderID]=[Forms]![Main Switchboard]![OrderLookUp]. Your problem is that the were condition wants you to enter a field name..and NOT a form name! So, you where condition needs to be "some field from the table = some value" You can try: dim strWhere as string strWhere = "OrderID = " & me.OrderLookUp docmd.OpenForm "Orders",,,strWhere -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.attcanada.net/~kallal.msn |
#3
|
|||
|
|||
OpenForm command
Is OrderLookUp on your switchboard a combo box? If so make sure the bound
column is the OrderID column in the combo box. Now change your macro to: [OrderID]=[Forms]![Main Switchboard]![OrderLookUp] -- Reggie www.smittysinet.com ---------- "Albert D. Kallal" wrote in message ... "Dan Cole" wrote in message ... Where Condition is [Forms]![Orders]! [OrderID]=[Forms]![Main Switchboard]![OrderLookUp]. Your problem is that the were condition wants you to enter a field name..and NOT a form name! So, you where condition needs to be "some field from the table = some value" You can try: dim strWhere as string strWhere = "OrderID = " & me.OrderLookUp docmd.OpenForm "Orders",,,strWhere -- Albert D. Kallal (Access MVP) Edmonton, Alberta Canada http://www.attcanada.net/~kallal.msn |
Thread Tools | |
Display Modes | |
|
|