By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,161 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

Household Bartender Access Tool

P: 1
Ok, I have a form that is bound to a table called 'Drinks'. This form (named 'Drinks') will allow me to browse through a collection of bartender recipes. I have created a button on this form that will launch another form, wittingly named 'Search', which is unbound. On the 'Drinks' form, it will initially pull a blank record so you can enter a new recipe which is autonumbered by the primary key. You can't browse through any recipes though until you use the search command. On this Search form I have a text box where you can enter in a drink name, three ingredient combo boxes that will allow the user to select an ingredient from a query which builds a list of all distinct ingredients in my table from all 15 ingredient fields, another combo box that allows the user to select of a type of serving glass from a query built to list distinct serving glass types, and a search type indicator that will eventually allow the user to select an 'And' or 'Or' search type. There is a cancel button that will close the Search form if clicked. The problem is the 'Search' button on this form. When I click this button what I would like to happen is for the VBA (which I know NOTHING about) to execute and return values back to the form from the table. For example, if I type in amaretto as a drink name, and then choose amaretto as an ingredient and sours mix as an ingredient and hit the 'And' indicator, it will return all results that have a name LIKE amaretto and has both ingredients in the recipe. If I would hit the 'Or' indicator it would return all results that something LIKE amaretto in the name, contains amaretto as an ingredient, or contains sours mix as an ingredient back to the form for me to browse through.

The question is, how do I make this happen? I have no friggin clue how to use VBA and I could really use some advice on this one. If anyone wants, I can e-mail them screen shots to show them whatever they want to see. ** Edit / Removed **. Thanks everyone!

Best,

Aaron
Jul 31 '08 #1
Share this Question
Share on Google+
3 Replies


Delerna
Expert 100+
P: 1,134
Yep.
Thats a big answer for 1 forum post.
You will have to use VBA.
So, I suggest you take a step backwards from your project and start some small database projects with the sole intention of learning to use vba to access the database objects such as tables forms queries etc.
Do you have any programming experience with other languages?
Don't worry, basic is a relatively easy language to learn.
Also we are here to help you over specific difficulties. Not to write the app for you, but we are more than willing to answer questions in areas you are having trouble with.

Once you are more familiar with vba then you will be able to start asking specific questions related to your project.

NOTE
I suggest you get in the habit of prefixing your objects with lowercase 3 character codes. For example you have a table called Drinks and you have a form called Drinks and at some stage you may have a query called Drinks.

If you reference Drinks in VBA.
Later on when you are debugging or extending your code, and you come across a reference to Drinks, how are you going to know which object you meant?


Much better if you use
tblDrinks for the table
qryDrinks for the query
frmDrinks for the form

Now in code you will instantly know which object tblDrinks is refering to when you see it.
This is called Hungarian notation and there is a set of commonly used prefixes in the helpfiles for access as well as on the internet.
You can use those or make up your own. Other programmers will recognise them if you use the established ones though

Good luck
Jul 31 '08 #2

Delerna
Expert 100+
P: 1,134
By the way. I suggested to start new databases for you learning so you don't corrupt what you have done in your drinks database by doing something wrong in VBA while you are learning
Jul 31 '08 #3

NeoPa
Expert Mod 15k+
P: 31,186
Aaron,

I've removed your email address from the public forum. We don't allow that here - mainly for your own safety.

As to your question, I will leave you in Delerna's capable hands for the moment, but you should realise that what you ask is not something appropriate for a beginner. It's quite advanced in practice.

Not that we can't help you get there - just don't be hard on yourself if you find it all a little complicated at times.

If it helps - Example Filtering on a Form is a sort of tutorial that uses some of the fundamental concepts of working dynamically with SQL strings and applying filters to forms that you will probably be using in this.

HTH & Welcome to BYTES!
Aug 5 '08 #4

Post your reply

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