Can't figure out why this errors (1 Viewer)

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 16:45
Joined
Oct 17, 2012
Messages
3,276
Cronk, the 'shortcut points to batch file on network that updates and then runs the app' approach is actually much less sophisticated than an integral self-update. Second, you might want to take a look at the link I provided the OP. :p
 

Minty

AWF VIP
Local time
Today, 21:45
Joined
Jul 26, 2013
Messages
10,371
Firstly, I put code in that immediately closes the FE if it is opened from anywhere other than the C drive.
@Cronk - You might have problems with this moving forwards, if you mean a root folder.
Windows 10 makes running things / copying things into root quite difficult at times as part of increased security. I would be tempted to test a Win 10 environment with your code to make sure it's compatible.
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 16:45
Joined
Oct 17, 2012
Messages
3,276
@Cronk - You might have problems with this moving forwards, if you mean a root folder.
Windows 10 makes running things / copying things into root quite difficult at times as part of increased security. I would be tempted to test a Win 10 environment with your code to make sure it's compatible.

I think he means just someplace on the C drive, not at the actual C:\ folder.
 

BoBaxter

Registered User.
Local time
Today, 16:45
Joined
Jan 16, 2017
Messages
18
Great ideas guys, thank you all! This is a very interesting discussion to me.

CJ - I am definitely going to split them out. You guys have sold me on that. Thanks for the info.

Frothingslosh - I have experience with a couple of batch files, but some of the users here do not have administrative privileges so that may run me into issues depending on where I am saving it. I really liked the code in the post and I think I am going to alter that a bit.

I'm at work and keep getting pulled away from these posts, so excuse me if I am partially coherent. I have tried to write this about 3 times.

The recordsetclone version of the originally posted code has been rolled out and works perfectly. I added a line to each part
Code:
 If .RecordCount > 0 Then
and I removed the beginning part of the code that looped through and set all the numbers to 0. I changed how the recordset is being pulled from
Code:
 Form_matform.Areas_subform16.Form.Filter
to
Code:
 Forms!matform.Areas_subform16.Form.Filter
It is working very well from what I have seen so far.
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 16:45
Joined
Oct 17, 2012
Messages
3,276
One thing you should be aware of - RecordCount specifically only counts the number of currently loaded records. This distinction is important because a large recordset won't load all at once, so if you ever need a count of the total number of records, you will need to either do a separate DCount or else use the recordset.MoveLast method before checking .RecordCount.

For determining if there are ANY records, you should be fine, although it's generally considered slightly better practice to check against recordset.EOF (or, if this isn't a fresh recordset, EOF and BOF at the same time).
 

BoBaxter

Registered User.
Local time
Today, 16:45
Joined
Jan 16, 2017
Messages
18
So you think I would be better off going with the below type of statement?
Code:
 If Not .bof and .eof then
I'd rather do the better practice since I kind of learn as I go and I have never really had much input on my codes (unless something was not working)
 

Users who are viewing this thread

Top Bottom