A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

OpenForm command



 
 
Thread Tools Display Modes
  #1  
Old May 18th, 2004, 03:01 PM
Dan Cole
external usenet poster
 
Posts: n/a
Default 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  
Old May 18th, 2004, 05:24 PM
Albert D. Kallal
external usenet poster
 
Posts: n/a
Default 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  
Old May 18th, 2004, 10:24 PM
Reggie
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.