Good Morning
My Images.zip
I have joined today in the hope that somebody may be able to help me with a complicated query problem that has been vexing me this week ! First off let me say that I have posted this question on the Access Programmers forum and received a partial solution, here is the link to that conversation
https://www.access-programmers.co.uk.../#post-1819933
This solution allows me to place two records (Images) side by side on an access form. The problem arises when I want to either sort or search the DB. The offered solution is :-
“ If I do everything for you, you will never learn or understand how your app works. but suggest you will need to do the following:
1. Include the sql of the query as your form recordsource
2. I don't use macro's Assuming you are just trying to use the standard filter option of
me.filter="myfield ='" & mycontrol & "'"
me.filteron=true
then use the following (I'm assuming Regn is text)
me.recordsource=replace(me.recordsouce,"WHERE True","WHERE [Regn] = '" & [Regn] & "'")
if you are using the filter parameter of openform, move your filter parameter (i.,e. "[Regn] = '" & [Regn] & "'") to the openargs parameter instead and in the form open event put
me.recordsource=replace(me.recordsouce,"WHERE True",me.openargs)
3. for sorting - you will need a to use controls to to identify which field field you want to sort on and the direction (think how websites work)
and the code would then be something like
me.recordsource=replace(me.recordsouce,"A.myTableP K>= B.myTablePK","A." & ctlSortbyWhat & cltSortDirection & "B."& ctlSortbyWhat)
ctlSortdirection would probably be a combo using a value list to indicate ">=" is ascending and "<" is descending “
I have been reading up on queries and VBA all week, but still do not have a clue how or where to insert this code into the query. I attach a copy of the DB, would somebody please put me out of my misery !!
Best Regards
Adrian