473,394 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

I want to know if I'm in a specific field on a form

489 256MB
I'm using the Calendar (ocxcalendar). I have five calendar fields on my form and I would like to use just one calendar and put an If statement as to what field I'm in. How do I do this? This is probably very simple but for the life of me I don't seem to be able to make it work.

Thanks for any help.
Jan 19 '16 #1

✓ answered by jforbes

I'm not quite sure what you are asking about. If you want to get the name of the control that currently has focus, you can use:
Expand|Select|Wrap|Line Numbers
  1. Screen.ActiveControl.Name
or for the previous control:
Expand|Select|Wrap|Line Numbers
  1. Screen.PreviousControl.Name

7 1093
NeoPa
32,556 Expert Mod 16PB
I use one that's a derivation of one that I inherited. The original call to the code passes the control as a parameter which is stored locally in the form.

It's a roll-your-own one using a simple Form.
Jan 20 '16 #2
jforbes
1,107 Expert 1GB
I'm not quite sure what you are asking about. If you want to get the name of the control that currently has focus, you can use:
Expand|Select|Wrap|Line Numbers
  1. Screen.ActiveControl.Name
or for the previous control:
Expand|Select|Wrap|Line Numbers
  1. Screen.PreviousControl.Name
Jan 20 '16 #3
NeoPa
32,556 Expert Mod 16PB
I considered posting something on those lines, JForbes, but couldn't see how the control referred to could be the active control as the calendar control would be. That said, I guess Tom must have got something from that as he's flagged it as the best answer.

Maybe the PreviousControl is what he likes it for. I don't know that object well enough to know if that can be guaranteed to be the one that triggered the calendar but it certainly would be in most cases. If not then passing a reference in the call might still make the most sense.
Jan 20 '16 #4
CD Tom
489 256MB
I was able to use the previouscontrol and it worked just like I wanted it to. Thanks for all the help
Jan 21 '16 #5
jforbes
1,107 Expert 1GB
Glad you got it working. I just took a stab at it.

I've never used the Calendar control. I've looked at it, but it didn't thrill me enough to move away from the .ShowDatePicker property built into the TextBox control.
Jan 21 '16 #6
CD Tom
489 256MB
I would be interested in ShowDatePicker as I'm having problems with the calendar when I try and compile the program using Access 2016 64bit version. I have a couple of users that have purchased the office 365 in 64bit and because they are using it with another database they have a problem switching between the two. When in my database it installs the runtime and then when they go back to their other version it tries to reinstall the 64bit version and they have to load it.
If you are anyone has had problems switching I would be interested in any help. I get type mismatch errors when compiling also.
Jan 21 '16 #7
NeoPa
32,556 Expert Mod 16PB
It's a minefield Tom. Be very careful.

That said, there is help out there. You may struggle finding all the relevant stuff though.

Good luck anyway :-)
Jan 22 '16 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: kkrizl | last post by:
I'm having a very bizarre problem. I open up my table in datasheet view, and I click on edit, find. In the Find and Replace dialog box, I enter an address (123 main for example). If I set the...
3
by: warnold | last post by:
my table contains a lot of fields, so i want to create a form with a combo box and a (probably) text box that goes like this... the combo box display the fields in the table. (this i've already...
3
by: mckbill | last post by:
Is there a way I can direct the cursor to a specific field (variable) in a form by typing the field name while in form view? I have a form with many fields, and it would be nice if there were...
5
by: theine | last post by:
How do I create Hyperlink based of a specific field in the same row? In Excel it done like this: =HYPERLINK("", A273) where the anything inside the " " is the value it's looking for in that...
1
by: sukatoa | last post by:
I still do the process of incrementing a specific field in a stand alone apps by query 1: get its value query 2: update value +1 But, i realize that this is really a bad idea when this would...
6
by: Stephane Landreville | last post by:
Hi. Using javascript, how can I enforce users to have to select a value from a dropdown list before proceeding to entering other values on a form? Steph
3
by: Ron Mowry | last post by:
I am wanting to create a macro that will fill a specific field on a form and then go to the next record set. I have a blank field in the table that the form is pulling from. I want the user to be...
8
by: Lucrecious | last post by:
How do I create a dynamic report based on a query that updates from a select field form? I followed the information from the article here entitled: "Checkbox form to allow user to select query output...
0
by: sourceinfo | last post by:
How do I set focus to a specific field in an external program? Our application is middleware that sends data to a different application through a port, but we then switch the screen focus to the...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.