Search bar from another MS template - Noob (1 Viewer)

Boch

Registered User
Joined
Dec 10, 2019
Messages
12
Hi,
I posted some weeks ago about a MS template I was altering/tailoring.
That work is pretty much done, however...

I have yet to find a decent search facility (using YouTube guides). The macro will only let you search 4 or so fields, yet the search facility on the 'Contacts' template on Access2013 (which I have used previously) is brilliant for what I need.

Can somebody provide a step by step guide as to how to implement the search from the 'Contacts' template to my new template (based on the personal contacts template) I'd like the search to be housed in the contact list table - as in the 'Contact' template (see images for a better explanation)

Ive also included what I think the macro is to make the search bar work.

Many thx in advance for any help
 

Attachments

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,329
Hi Boch
I don't use macros nor do I have the Contacts template.
However I know from experience that the MS templates can be difficult to modify and its often easier to start again...which I realise isn't what you want to hear.

Anyway there are plenty of good examples available. Here are two by Allen Browne Multi field Search form, Find As You Type.

In addition, using the forum advanced search will provide many examples. I know MajP has offered his own Find As You Type example based on a class module recently.

I hope that is some help even if only indirectly. Good luck
 

Boch

Registered User
Joined
Dec 10, 2019
Messages
12
Hi Boch
I don't use macros nor do I have the Contacts template.
However I know from experience that the MS templates can be difficult to modify and its often easier to start again...which I realise isn't what you want to hear.

Anyway there are plenty of good examples available. Here are two by Allen Browne

In addition, using the forum advanced search will provide many examples. I know MajP has offered his own Find As You Type example based on a class module recently.

I hope that is some help even if only indirectly. Good luck

Hi, thx for that - if you have MS Access then you have the templates: file > new and then choose the template you need, which is what I've done nd manipulated to create the db I was after ( See images for the record data input).

Will have a look on the site you rec to see if it can resolve the issue though. Many thanks
 

Attachments

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,329
Your post was moderated which can happen when new members post code or attach files.
I actually did download the Contacts template a few years ago but deleted it again. Like a lot of the templates it uses embedded macros, attachment fields and if I recall correctly also has multivalue fields, all of which I avoid. However, if it suits your purposes that's fine.

Good luck
 

Boch

Registered User
Joined
Dec 10, 2019
Messages
12
Have to ask, is there any particular reason why you avoid the things you've listed.
Still kinda noob level, so curiosity more than anything else.

I used the link you provided and eventually got it to work. The virtually finished product looks like this
 

Attachments

isladogs

CID Moderator
Staff member
Joined
Jan 14, 2017
Messages
12,329
Glad you've solved your problem.

Most experienced developers avoid all those features.
1. Both embedded macros are saved macros are less powerful than using VBA code and are 'hidden away'. Recommend using code instead.
2. Attachment fields cause significant file bloat which slows down your application and will eventually clause your file to hit the 2GB limit making it unusable. Instead save the path of the file(s) and then open them from Access.
3. Multivalue fields cause numerous issues - see this article http://www.mendipdatasystems.co.uk/multivalued-fields/4594468763. Attachment fields are a type of MVF.
4. Also avoid using lookup fields at table level - see http://www.mendipdatasystems.co.uk/table-lookup-fields/4594445135

Hope that helps. Good luck with your project.
 

Boch

Registered User
Joined
Dec 10, 2019
Messages
12
hi Isladogs.

I've been thinking regarding what you said about attaching files to the db & I like the sound of just linking the folder on my storage where the files connected to the record reside.

EG: path to folder looks like this: W:\CA Chefs\CA Temp chefs\ <chef's name>
How do I create the path to the folder in the record?
tried using a hyperlink box & it didn't work :(

Many thanks
 

Micron

AWF VIP
Joined
Oct 20, 2018
Messages
1,749
If you have files that relate to records you would store the path in a table. Likely that should be a separate table that contains the primary key value from the main table as a foreign key value in the paths table. I'm suggesting that as it's more likely that not every main record will have an attachment so that method will eliminate having null values in many/most main records. The msoFileDialogFilePicker is often used to navigate to the file using a Windows Explorer type of dialog. Once a file is chosen, the code stores the path in the table. To make use of that path depends on what you need. One way is to use the Application.FollowHyperlink method but here is a link about that. If you intend to show a pic on a form, then you set the Picture property of an image control to be the path for the current record. Then there is the object frame for application files such as Word documents.
Hope that helps.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom