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

Boch

Registered User.
Local time
Today, 11:48
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

  • MS Access search post.zip
    68.1 KB · Views: 113

isladogs

MVP / VIP
Local time
Today, 18:48
Joined
Jan 14, 2017
Messages
18,186
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.
Local time
Today, 11:48
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

  • MS Access new db record.zip
    128.3 KB · Views: 109

isladogs

MVP / VIP
Local time
Today, 18:48
Joined
Jan 14, 2017
Messages
18,186
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.
Local time
Today, 11:48
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

  • Access DB record1jpg.jpg
    Access DB record1jpg.jpg
    86.4 KB · Views: 115
  • Access DB record2.jpg
    Access DB record2.jpg
    70.2 KB · Views: 112
  • Access DB record3.jpg
    Access DB record3.jpg
    67.4 KB · Views: 119
  • Access DB table header.jpg
    Access DB table header.jpg
    25.3 KB · Views: 107

isladogs

MVP / VIP
Local time
Today, 18:48
Joined
Jan 14, 2017
Messages
18,186
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.
Local time
Today, 11:48
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
Local time
Today, 14:48
Joined
Oct 20, 2018
Messages
3,476
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

Top Bottom