473,326 Members | 2,133 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,326 software developers and data experts.

Autocomplete in Access

Hi

In my database I have a table to record absence. The table has a start date column and an end date column. As staff seem to often have one day bugs (a seperate issue to work out!!), I would like the end date column to automatically populate with the date that was put in the start column. But also allow it to be written over should they have something more serious!

I'm fairly new to access still, so hopefully its not too complex?

Thanks in advance for your help!!
Jul 2 '09 #1
4 2029
beacon
579 512MB
Hi Fluffy,

Personally, I would prompt the user. That way they can have the choice to populate it with the date or not and you won't have to worry about whether the user won't be able to overwrite the date that is populated.

I would use something like the following code to achieve this:
Expand|Select|Wrap|Line Numbers
  1. Private Sub StartDate_AfterUpdate()
  2.      If vbYes = MsgBox("Is the end date the same as the start date?", vbYesNo) then
  3.           EndDate = StartDate
  4.      Else
  5.           'Do Nothing
  6.      End If
  7. End Sub
  8.  
Jul 2 '09 #2
missinglinq
3,532 Expert 2GB
Nothing at all wrong with doing that, especially if the absence StartDate and EndDate are not always entered at the same time. This allows the date to be overwritten:
Expand|Select|Wrap|Line Numbers
  1. Private Sub StartDate_AfterUpdate()
  2.   Me.EndDate = Me.StartDate
  3. End Sub
Welcome to Bytes!

Linq ;0)>
Jul 2 '09 #3
beacon
579 512MB
@missinglinq
Good call Linq. I thought about that, but I work with users that get complacent when things are done for them so I went this route instead. Either way, they're two good options to choose from.
Jul 3 '09 #4
missinglinq
3,532 Expert 2GB
My signature

There's Always more than one way to skin a cat!

kind of says it all! I try to stress, where appropriate, that many posters' situations are unique to them, and that [b]absolutely, positively don't/B]... should only be used when talking to your kids about drugs and alcohol! There are simply too many variables where absolutes don't apply. And the same goes for people responding to posts. Everyone trying to help is doing so based on their experiences. And you have to always keep that in mind!

Linq ;0)>
Jul 3 '09 #5

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

Similar topics

4
by: bc | last post by:
Hi, Is it possible to detect if the IE autocomplete function in a current context such as a textbox is activated (ie. dropdown with previously entered info is visible)? Problem: I use a script...
40
by: Alex | last post by:
Hello, does anybody know how to turn off the autocomplete feature for a certain text field? I am aware of the "autocomplete" attribute, but I have seen other implementions achieving it...
1
by: Georg Scholz | last post by:
Hello, The class "Control" contains a documented Property "ControlType". So for example, in a form, you can write code like this: Dim c as control set c = me.Controls("textbox1") if...
19
by: Bernie Yaeger | last post by:
Everyone misses the point on this - what we need is a combobox autocomplete that is a dropdownlist only. When in dropdown mode, you can enter text - making that autocomplete is trivial. But when...
2
by: Mrinal Kamboj | last post by:
Hi , Need to get some basic info regarding AutoComplete Attribute in COM+ . I am having a class with TransactionOption set to Required , now for this class , can i mark all the methods with...
1
by: thubba2000 | last post by:
We have a web application developed using IBuySpy. In older versions, Autocomplete on all web forms works. In our latest version, it stopped working on all clients. I have gone through all the...
1
by: rbg.net | last post by:
I know that there is a autocomplete property for the HTML "INPUT type=text" control which if set to OFF, disables autocomplete of the input textbox (doesn't remember previously entered values) ...
1
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function...
3
by: John | last post by:
AC2007 I changed my combo's row source and then the autocomplete stopped working. The combo is two columns, bound to the first. First column is primary key (ID). Second column is a...
0
by: =?Utf-8?B?cG1haw==?= | last post by:
I try to implement a AutoComplete function to the datagridviewtextboxcolumn to a Datagridview control with several others datagridviewtextboxcolumns. This function is meant to apply to the column,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.