Split form to display query help plz (1 Viewer)

christakis

Registered User.
Local time
Today, 17:38
Joined
Oct 23, 2009
Messages
72
Hi guys,

I am trying to create a form which is split into two parts to filter the records of a table. The top part will have search fields and the bottom part will show the results of a query.

I managed to create the query to filter assets based on the Preferred field of table "comAssets". The query should read the contents of combo box cboPref in form "Form1" and filter accordingly.

If cboPref is null then the query returns all records (works ok) but the query fails for any other value of cboPref. Since the query works fine when the form is closed and you manually type in the value, I suspect the combobox is to blame. This is also the reason I posted this problem under Forms.

cboPref provides options based on table tblValues.

I know nothing makes sense to you so far so I included the database for you to play with. This is a very trimmed down version of the original but you should get a basic idea of what I am talking about.

I would also appreciate if you could explain me how to get the query results to show in the form.

Best Regards,
Christakis
 

Attachments

  • SimpleDatabase.zip
    147 KB · Views: 159

olxx

Registered User.
Local time
Today, 09:38
Joined
Oct 2, 2009
Messages
36
I´ve no I idea is it that what you wanted but created little something, hope it helps!
 

Attachments

  • SimpleDatabase.zip
    167.3 KB · Views: 733

christakis

Registered User.
Local time
Today, 17:38
Joined
Oct 23, 2009
Messages
72
I´ve no I idea is it that what you wanted but created little something, hope it helps!

Yup! that's exactly what I meant. I've tried 1000 different things for 6 hours today and you did it in 5 min. Thank you :) I will have a a dig in what you did, hopefully I can apply it further.
 

olxx

Registered User.
Local time
Today, 09:38
Joined
Oct 2, 2009
Messages
36
Well you had done there something that i didn´t completely understand either :). I added a table there, i´m sure you figure out why. If you get stuck or have any questions post it here or PM.

olxx
 

christakis

Registered User.
Local time
Today, 17:38
Joined
Oct 23, 2009
Messages
72
Hi olxx,

Thank you for your reply.

The final database will have many options to choose for each asset. Creating a table for each field sounds that things are going to be messy (A lot of tables). By creating one table which has all values to choose from would surely make things simpler. This table will only include options which are rarely changed. Do you think this is a bad idea?

Best Regards,
Christakis
 
Last edited:

olxx

Registered User.
Local time
Today, 09:38
Joined
Oct 2, 2009
Messages
36
You don´t need an extra table at all to choose a value. I just made it as an example because i didn´t know where to get the list for combobox. Seems to me that you´re trying to create a new project so start normalizing your tables. Right structure is most important or you´ll have to face a lots of problems later. Don´t store duplicate values and calculated fields etc. Those things you already know i suppose. All questions are welcome thou.
 

christakis

Registered User.
Local time
Today, 17:38
Joined
Oct 23, 2009
Messages
72
You don´t need an extra table at all to choose a value. I just made it as an example because i didn´t know where to get the list for combobox. Seems to me that you´re trying to create a new project so start normalizing your tables. Right structure is most important or you´ll have to face a lots of problems later. Don´t store duplicate values and calculated fields etc. Those things you already know i suppose. All questions are welcome thou.

Thank you for the tips. Indeed this is a new project. I have used access before but ages ago. I designed my tables with expansion in mind so although they might not be perfect (some fields are just not worth the effort) they should be good enough to expand later on.

I almost finished a big chunk of it today but for some reason it crashed and i lost most of my forms. Everything else seems unaffected. I don't know what went wrong but I hope it doesn't happen again.

I really appreciate your help. I definitely saved hours of stressful disappointment.

Cheers again,
Chris
 

Users who are viewing this thread

Top Bottom