473,405 Members | 2,294 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

query results in a subform

Hello everyone,

I am very new to Access so I definetely need help. I have a form with two combo boxes (outbound): 1.- City Names and 2.- Postal Codes

These combo boxes are based on a Table which I called SD and contains five fields: City Names, Postal Codes, Province, Terminal and Carrier.

On the form I have created a command button that search for values entered in the combo boxes based on a query named Routing. Basically looks at the city names and postal codes in the combo boxes and returns the city, postal code, province, terminal and carrier. I got this working fine.

Now, the issue I am having is that I want the results from the query to be displayed as a subform and I can get this to work. I have created a sub-form based on the query.routing and all it does is to show all the results.

Any suggestions are welcome. Thanks..!
Feb 12 '07 #1
17 2643
NeoPa
32,556 Expert Mod 16PB
I suspect that (Example Filtering on a Form.) could have been written especially for you ;)
Feb 12 '07 #2
I suspect that (Example Filtering on a Form.) could have been written especially for you ;)
Hi NeoPa,

I just got this workng fine by changing the command button from running a query to refreshing form data. However now I am getting the message: The expression OnEnter you entered as the event property setting produced the following error: The object doesn't contain the automation object 'searchForm' when I hit enter....It works fine if I click with the mouse on the button.

Any idea why this is happenning and how I can solve this...

Thanks,
Feb 14 '07 #3
Rabbit
12,516 Expert Mod 8TB
Can you post the code so we can see where it went wrong?
Feb 14 '07 #4
Can you post the code so we can see where it went wrong?
Hi Rabbit,

Here is the code;

Expand|Select|Wrap|Line Numbers
  1. Private Sub Test_Click()
  2. On Error GoTo Err_Test_Click
  3.  
  4.  
  5.     DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
  6.  
  7. Exit_Test_Click:
  8.     Exit Sub
  9.  
  10. Err_Test_Click:
  11.     MsgBox Err.Description
  12.     Resume Exit_Test_Click
  13.  
  14. End Sub
  15.  
I tried using the same code and just changing Click for enter but it didn't work either....Hope you can help me
Feb 14 '07 #5
Rabbit
12,516 Expert Mod 8TB
The only possible place where the code can go wrong is in your DoMenuItem. Are you sure 5 is the correct option?

I don't know what item 5 is so you'll have to tell me.
Feb 14 '07 #6
The only possible place where the code can go wrong is in your DoMenuItem. Are you sure 5 is the correct option?

I don't know what item 5 is so you'll have to tell me.
Hi Rabbit,

How do I know which Item 5 is? Access is using this code when I created the command button for refreshing the data in the subform
Feb 14 '07 #7
Rabbit
12,516 Expert Mod 8TB
You want to refresh? Replace 5 with acRefresh
Feb 14 '07 #8
You want to refresh? Replace 5 with acRefresh
Hi Rabbit,

I could get rid of the error by going to the subform properties and deleting the OnEnter which was SearchForm.Requery. Now seems to work fine, however when I enterered a value in the postal code (unbound combo box) the cursor goes to the subform intead of the command button...do you know how I can fix this?...Thanks
Feb 14 '07 #9
Rabbit
12,516 Expert Mod 8TB
If you right-click anywhere in the form and select Tab Order, you can change the order in which controls get focus after the user Tabs or presses Enter.
Feb 14 '07 #10
If you right-click anywhere in the form and select Tab Order, you can change the order in which controls get focus after the user Tabs or presses Enter.
Thanks a lot Rabbit...!! It's working fine now.

I have the form as a pop up, Do you know how I can protect it so the user just see the form and not the queries or tables
Feb 14 '07 #11
Rabbit
12,516 Expert Mod 8TB
From the menu Tools > Startup, you can select the startup options when someone opens the database. You can select what form opens and what menus are available, among other things.

To bypass the startup, when you open the database, hold Shift until it opens. This will allow you full access. If you need it more secure and you and the user are using MS Access 2003, create a backup of the .mdb file and convert one to a .mde file. But make sure you make a backup because you can't make any changes to a .mde file.
Feb 14 '07 #12
From the menu Tools > Startup, you can select the startup options when someone opens the database. You can select what form opens and what menus are available, among other things.

To bypass the startup, when you open the database, hold Shift until it opens. This will allow you full access. If you need it more secure and you and the user are using MS Access 2003, create a backup of the .mdb file and convert one to a .mde file. But make sure you make a backup because you can't make any changes to a .mde file.
Thanks rabbit....How do reverse the startup options?
Feb 14 '07 #13
Thanks rabbit....How do reverse the startup options?
I got it..!...Thanks for your patience.
Feb 14 '07 #14
Rabbit
12,516 Expert Mod 8TB
Not a problem.
Feb 14 '07 #15
Not a problem.
Hi Rabbit,

I have a couple of questions. If I want to set up a password, access asks me to have the database open for exclusive use, How do I do this? also How do I convert the file to a .mde file? I went to the file and change it (rename it), however I still can go on the table and make changes....

Thanks,
Feb 22 '07 #16
NeoPa
32,556 Expert Mod 16PB
I think that it will allow you to make design changes like this when opened normally, as long as no-one else has the database open at the same time. It will convert the open-mode to exclusive on-the-fly.
However, should you want to open it explicitly as exclusive (and there must be no-one else with the database open for this to work), then :
  • Click on the Open button.
  • Select the database you want to open.
  • Click to drop-down the list on the Open button.
  • Select Open Exclusive.
.

NB. This is in Access 2003. I imagine it is similar in other versions. If not, then look for some form of Options button within the Open dialogue box for similar functionality.
Feb 22 '07 #17
NeoPa
32,556 Expert Mod 16PB
How do I convert the file to a .mde file?
Some points to remember about MDE files.
  • The design of the database is not modifiable once it's been converted to an MDE file. It is absolutely critical that you keep a master copy of the database (MDB) file somewhere safe before converting it to an MDE.
  • The design of the database is not modifiable once it's been converted to an MDE file. It is absolutely critical that you keep a master copy of the database (MDB) file somewhere safe before converting it to an MDE.
Well, it was a very important point.
To convert a Database (MDB) file to an Executable (MDE) file (Access 2003 but other versions will be similar) :
  1. Select Tools / Database Utilities / Make MDE File...
  2. Select the database to convert.
  3. Click on Make MDE.
  4. Enter (or select) a filename for your new MDE file.
Feb 22 '07 #18

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: cassandra.flowers | last post by:
Hi, I was wondering if it is possible (Using access) to have a query parameter as a drop down box rather than a text box? e.g. typing as criteria for a query produces a box with a text box...
3
by: John young | last post by:
I have been looking for an answer to a problem and have found this group and hope you can assist . I have been re doing a data base I have made for a car club I am with and have been trying to...
1
by: teddyparnell | last post by:
I have a query that works, but then displays the results in a datasheet view. The query is reliant on the results of a combo box, and when i update this combo box and click a button the results of...
0
by: quang | last post by:
I have a subform within my results form that I use to display the results of my queries. Here is the problem: once the query has run and its results are displayed in my subform - if you make any...
2
by: Smartin | last post by:
Using Access 97 I am trying to create a form that allows for user entry of search terms and displays a table of results. I thought I could accomplish this using a subform but it isn't quite...
8
by: GeorgeSmiley | last post by:
Does anyone know of a way, via VBA, to set the screen position of query results to a particular top, left position? I've glanced at API techniques but cannot find exactly what will do the trick....
1
by: tomlebold | last post by:
Having problems displaying query results from combo boxes on a sub form, which is on the same form that is used to select criteria. This has always worked form me when displaying query results on...
8
by: olivero | last post by:
Hi group, Is there an easy way to make a form create the same set of fields dynamically, once for each record returned by a query? I have a query that's being called from a form and the results...
1
by: aaronkm | last post by:
Hello thescripts and well met. I've recently been handed a new duty and have the joy of 'crash coursing' MS Access. Things are working well but I've ran into a problem that I can't seem to find...
16
by: dougmeece | last post by:
Good day everyone, I have a database with 2 main forms. The first form is used to add records to the database and contains a command button that opens the 2nd form for records searching. On...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.