473,320 Members | 1,945 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,320 software developers and data experts.

Displaying the LAST record selected on a textbox (remembering last value)

135 100+
Hello,

I have a textbox where the user enters a category for a product selected on a combo box. The user has to select a LOT of products and most of the time he enters them in order of category, so for every product (new record) he has to type AGAIN the "category" in the category textbox. Is there a way that this textbox "remembers" the last thing typed in, so that if its correct the user DOESNT have to type again???? But that he could also type a different thing in case the last category doesnt apply to the new record (product)???

Please help,
Gilberto
Sep 20 '07 #1
5 2815
NeoPa
32,556 Expert Mod 16PB
Consider some code which notes the value of the category when a new record is succesfully added and sets the default value of the control on the form to that value. This will not effect the layout of the underlying table and will be temporary for that instance of the form.
Sep 20 '07 #2
Gilberto
135 100+
Consider some code which notes the value of the category when a new record is succesfully added and sets the default value of the control on the form to that value. This will not effect the layout of the underlying table and will be temporary for that instance of the form.
Thanks NeoPa...for ALL your replies. Could you give me any code to achieve this and where/what event should i enter it?

The table is called ENGINEERING with the LEVEL4LABEL field.

The form is called ENGINEERING and the textbox called LEVEL4TEXT.

Thanks
Sep 20 '07 #3
NeoPa
32,556 Expert Mod 16PB
I'm afraid this is not a coding service Gilberto.
We try to assist people to understand the subject better and help them past their hurdles.
I am happy to spend some time assisting and answering relevant question, or even explaining issues, but I will not simply provide you with the code. I will, however, step in with comments (or even code) when you post your attempts as long as they seem honest attempts to get the job done.

As to the event used, I would suggest the AfterUpdate event of the form (the form must be bound to the recordset). This will enable you to catch the update as it's happened and (testing Me.NewRecord) determine if the Me.ControlName.DefaultValue needs to be changed. Me.NewRecord may only be set in the BeforeUpdate event as it happens. You will need to check that out and use that event instead if necessary. If I find an answer to this I will post.
Sep 20 '07 #4
NeoPa
32,556 Expert Mod 16PB
As luck would have it, it does need to be in the Form_BeforeUpdate procedure. I did some tests and the Me.NewRecord property is reset (understandably enough) when the record is saved.
Sep 20 '07 #5
Gilberto
135 100+
As luck would have it, it does need to be in the Form_BeforeUpdate procedure. I did some tests and the Me.NewRecord property is reset (understandably enough) when the record is saved.
I get your point, totally understandable. I will try to follow your comments, do some testing and see what happens.

Again, thanks for your time and effort.
Gilberto
Sep 20 '07 #6

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

Similar topics

1
by: PT | last post by:
I got a problem. And thats..... First of all, I got these three tables. ------------------- ------------------ ---------------------- tblPerson tblPersonSoftware ...
3
by: jason | last post by:
I've got this javascript routine (i found on google - thank you) in an asp.net page that on page reload sets the cursor of a textbox to the last line. It works great! Using a similar concept, I...
5
by: tdmailbox | last post by:
I have a form with a child form. In the child form there is a list of names that can grow quite large. On the parent form I want to display the first name from the child form. I set up a test...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
2
by: Robert | last post by:
I have a label on my form lblCount and the following code in my form for displaying a record count: Private Sub Form_Current() Me.RecordsetClone.Bookmark = Me.Bookmark Me!lblCount.Caption =...
5
by: Bill | last post by:
Hello, Could anyone post some simple code or advise me on how I can display the SSN number like *****7890 in a text box, even thought the user entered 1234567890, and the value of the variable...
3
by: Richard Carpenter | last post by:
I understand how to use a dropdown list control to display the associated description value for a foreign key in a parent rather than the key itself, but I don't like having to disable the control...
6
by: jasone | last post by:
Hi all! im developing a system where a user can select what flower goes into their bouquet, and ive become a little bit stuck... heres what ive done to date: currently ive got a page displaying...
482
by: bonneylake | last post by:
Hey Everyone, Well i am not sure if this is more of a coldfusion problem or a javscript problem. So if i asked my question in the wrong section let me know an all move it to the correct place. ...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: 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...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.