The only things that you can access (no pun) for controls are the Properties that are appropriate for each (type of) control you see at Design time. The "bring to Front/Send to Back" are NOT properties defined directly against ANY (type of) control, so the ONLY way to do what you want...
Your problem is because you are ruuning your code from the "GotFocus" of a control on your FIRST form (why you are doing that I can't understand).
If you MUST (or want) to have this code run at the OnFocus of 'Check16', do it this way:
(i) Cut ALL of your existing code from behind...
Another thing to look for (and is REALLY wierd) is for any Boolean compares. There is an identified bug (and as far as I know, as yet not corrected) where if you have code such as:
IF bol_YourField THEN
..... do something
( Else) ......
( Endif)
It should be changed to
IF...
In a Module (or behind a button on a form), put the following
Dim Where_is_Access as string
Where_is_Access = SysCmd(acSysCmdAccessDir)
After you run that the string filed (Where_is_Access) will contain the location you are wanting.
This will do it (if you need to woory about holidays in that period I have code to handle this as well, but it needs a seperate table with the holiday dates in it).
Requested code follows:
Public Function DiffWeekDays_TSB(datDay1 As Date, datDay2 As Date) As Long
' Comments ...
DEFINITELY keep the photos outside of your database and only keep a link to them within table/s in the database. Storing photos (etc) in a database itself will cause the most SEVERE case of "database bloat" which can cause all sorts of problems. Also allows for the photo itself to be...
Your problem is at the "DoCmd.Openform" line.
You are opening that form, but because you haven't opened it as a "dialog" box any/all code which follows the DoCmd.Openform line continues to process and so the DoCmd.HourGlass False line which follows is processed simply...
Miove the code that you have at your "onLost Focus" to the "AfterUpdate" event for that field
You could also change your & Chr(13) to " & vbCrLf" (for readability.
There a lots of similar "vb" controls (e.g. vbTab, vbYesNo etc)
At your appropriate points put the following (or better still, make it a Private function and Call it from your appropriate points (so you only have the one piece of code)):
If Me.Dirty = True then
msgbox <with your prompt>
.... do whatever code or process you want here
End If
I have "snipped" a portion of a complete module I use to open up another session of Access and close the currebnt section (under certain circumstances).
You could try this if you like.
I also ensure that if the current session is running under "runtime" version that the...
I agree with the previous post re NOT using Autonumber fields for "meaningful data".
If you need to generate random numbers look up the RND function/statement under Access help
To GingerR
Cool !! - thanks for this tip. Have just implemented it myself and (hopefully) it gets rid of a worry for me re a 250+ user system operating across a WAN.
Oops !!!! - an addition to my previous post.
If your users are running an MDE you will NOT be able to do the before mentioned steps as you cannot get the database opened in design mode. You will have to get YOUR .MDB file onto their PC(s) and then do the above.
This normally happens when there are "missing" libraries.
If your users are running an MDB file then do the following:
Open database in design mode (hold Shift key down when starting)
Open ANY module in "design" mode
Then select menu option - Tools/References...
The following code will do what you want.
I have used an Access table containing two fields, one for your data, and the second for the replaced data (group of spces replaced with a Tab) data to achieve the result.
The table details I have used are :
TableName = YourTable...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.