VBA Access - How to make Access wait. (1 Viewer)

Minty

AWF VIP
Joined
Jul 26, 2013
Messages
6,539
Hi Minty
DISTINCT certainly makes queries read only.
DISTINCTROW should not do so...though its superfluous here
Good spot Colin, I obviously can't cope with words longer than 8 characters... :p
 

ZTAtZAU

Registered User
Joined
Feb 27, 2019
Messages
12
Yup

Code:
SELECT [COLOR="Red"]DISTINCTROW [/COLOR]MyTbl.*
FROM MyTbl;
You are only returning unique records, which effectively groups them making the recordsource not editable .

As hint for future debugging of similar issues, simply paste your rowsource into the query editor and see if you can edit the data.
Thanks Minty! Sorry it took so long to reply. Utility workers inadvertently cut my internet cable so I couldn,t get online. I'm now at an outside venue with a public wifi so won't say any more right now. I do appreciate your reply!

ZT
 

ZTAtZAU

Registered User
Joined
Feb 27, 2019
Messages
12
Try removing DISTINCTROW. Not needed if you only have one table.
However I don't think that will solve it!
Thanks for your reply Isladogs. See my reply to Minty above to understand my current internet situation. Hopefully, I'll be back up and running tomorrow or Saturday.

BTW: I couldn't see any of the links you provided because I didn't have 10 posts yet here on the forum. This post makes 10 so I should be able to see your links next time I log on!

Ill be experimenting with this and other issues and report back.
I do appreciate your help!

ZT
 

ZTAtZAU

Registered User
Joined
Feb 27, 2019
Messages
12
Minty and Isladogs,

As for the DISTINCTROW in the query SQL I posted above, I should say I've never really written my queries in SQL. I normally build all my queries in the access query design window by adding tables and the fields I want to see; add any desired sorting; and then any necessary criteria expressions in the criteria row under the field columns.

I just clicked the view SQL button in the query builder design window to be able to copy and paste a description of my form's recordsource (query) in reply to MajP's request. So I don't really understand what particular feature of my query caused the DISTINCTROW to appear in the SQL statement.

ZT
 

Cronk

Registered User
Joined
Jul 4, 2013
Messages
2,232
Going way back to #31
However, because of the "read-only" problem I was having with my custom pop-up form,

The pop up should only be collecting data and not bound, nor should any control be locked - same as an InputBox.


Maybe I missed something in my cursory reading of this thread but to repeat, the pop up is emulating the input box, merely collecting data. Processing should be in the calling form.
 

ZTAtZAU

Registered User
Joined
Feb 27, 2019
Messages
12
Going way back to #31

The pop up should only be collecting data and not bound, nor should any control be locked - same as an InputBox.
Maybe I missed something in my cursory reading of this thread but to repeat, the pop up is emulating the input box, merely collecting data. Processing should be in the calling form.
Thanks Cronk! Your suggestion is well taken.
ZT
 

Falcone203

New member
Joined
Dec 5, 2019
Messages
8
sorry ax, i misunderstood

i thought you were aking how to make a programme wait.

----------
I still feel it is better to understand why we need it to wait - and assuming its some sort of synchronisation issue, see if there is a more appropriate solution



in particular this code, without any doevents will just "hang" access - so you would vertainly want to put the hourglass up before doing it this way.
It crashed my program:banghead:
 

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

Top Bottom