How to Deselect a highlighted row (in query), pls

PurrSent

Board Regular
Joined
Jun 7, 2014
Messages
142
Windows 10 v20H2 (19042.1083)
MS Access 2019

I've recently upgraded to this version of Access, so I'm still finding my way around differences from previous version of Access.

I'm sure there is a very simple and quick answer to this question but, currently, I'm stuck.

I'm trying to do envelopes, and letter, using Mail Merge (Word 2019) which I have done many times but, today, I can't find the solution to deselecting a row in the database. Consequently, when I do the Mail Merge, the only data that comes through, ie on label sheet, or letter, is the one row that happens to be highlighted and I just can't figure out how to get this highlight off.

As a temporary measure, I've just highlighted the whole of the query results sheet, so they ALL come up on the merge.

Would some very kind soul please put me out of my misery and let me know what I'm not doing? I've had this issue before bit I can't remember the solution (but in previous version used - 2010, I think)

Many thanks
%
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Can you provide a sample/copy of your database with a few records to highlight the issue?
Also, would be helpful for context if you could post the code you have that selects the data in/from Access and invokes your mailmerge.
 
Upvote 0
Can you provide a sample/copy of your database with a few records to highlight the issue?
Also, would be helpful for context if you could post the code you have that selects the data in/from Access and invokes your mailmerge.
Thanks for replying @jackd

The Database is only one main table with a variety of queries, ie no relational tables

Unfortunately, the data concerned is personal data and GDPR applies so I'm unable to supply you with a sample. However, the data is just normal text, ie name, address, number of years being Member (this is for Charity stuff) plus other data. I am trying to print selected address labels so, for the selected data, I just type 'Y' in a particular column of those I need to merge. It just happens that the first line of the query result is highlighted so that is the only person who the PC puts on the label. If I highlight a different row, only that data will get 'seen'

As for the code, perhaps you could let me know how to get this, please?

Apologies
Thanks
 
Upvote 0
We will need to see the data that is being selected for the Mail Merge.
Sounds like you need a recordset to select all the "data" marked "Y", then sen that data to the mailmerge.
Probably a do while not recordset.eof construct with a loop
 
Upvote 0
We will need to see the data that is being selected for the Mail Merge.
Sounds like you need a recordset to select all the "data" marked "Y", then sen that data to the mailmerge.
Probably a do while not recordset.eof construct with a loop
"We will need to see the data that is being selected for the Mail Merge."
The row which is selected can be any of the rows. Whichever row is highlighted is the only data that is used and seen on a label sheet. All I'm asking is how to clear any highlighting on the query sheet.

There must be an easy way to clear the query of any highlighting. I don't believe it has to be this complicated

Thanks
 
Upvote 0
Show us thee SQL of the query.

How did/does the row get highlighted?

You could make a copy of the database. Then, in that copy, change the names to Porky Pig, Daffy Duck, Polly Dacktyl...... to remove any linkage to real data. Change any fields to "mockup" values. We only need the structure and logic, NOT the REAL data values.
 
Upvote 0
You're asking to 'remove' the row highlight because that is the only row that gets merged. Perhaps doing so would mean that nothing would be merged as a result?
I cannot tell if you're working in Word and getting the data from Access or the other way around but I suspect it is the latter. Perhaps show the code and it might reveal why it is only the selected record. Also do you mean the entire record is "highlighted" or is it just selected?
 
Last edited by a moderator:
Upvote 0
Hi @jackd and @Micron

You'll be pleased to know that the Mail Merge was working y'day and so I've managed to complete the task, at last.
As to what was going on, I really don't know. Maybe a quirk in the software but, more likely, something I did, or didn't do, causing the output to fail me. I was convinced it would be something 'simple' or 'user error' but couldn't work it out

I thank you both for trying to help and I apologise for not understanding your questions and requirements. I am a 'home user' and only intermittently use this function, so it's easy for me to make mistakes, of course ;)

@Micron
Just to confirm I use Word 2019 for the template letter / labels and Access 2019 to pull the data from, using 'Mail Merge' in Word.

Also, may I ask what the difference is between 'highlighting' vs 'selecting' a row (record) in Access please? I thought they were one and the same but perhaps infer a difference?

Many thanks
 
Upvote 0
Perhaps that was not well put. In an Access table or datasheet you can click on the record selector on the far left and the entire record will highlight. If you click in a field, the field gets a border. Either way that record becomes the current record which can be known. Regardless of whether the entire record is "highlighted" (selected) or just one field, you can use the Form.CurrentRecord property to do that.
 
Upvote 0
Perhaps that was not well put. In an Access table or datasheet you can click on the record selector on the far left and the entire record will highlight. If you click in a field, the field gets a border. Either way that record becomes the current record which can be known. Regardless of whether the entire record is "highlighted" (selected) or just one field, you can use the Form.CurrentRecord property to do that.
Hi @Micron
Thanks for reply. I've forgotten so much of the terminology, especially regarding Access, even though I studied it at depth, but that was over 10 yrs ago now!!! ;) However, thanks for clarifying that re highlighting a row or selecting a field

I have to say, I don't use the form facility but prefer to use a template letter and select the places for data input. At least, doing it this way, I can (have to) remember how it's done LOL If too automated, ie wizards etc, I'd totally forget and then struggle to create another/different/edited letter ;)

Thanks for all your help. I really appreciate this forum, with the knowledge and expertise that you all have :)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top