473,569 Members | 2,772 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select newly added element in a list based on a sql

I am using WinXP and MS Access 2003.

I have a list whose row source is an sql. I insert a new record to the
table the sql takes its data from. I requery the list and the new
record appears.

Problem: As soon as I have done the requery I want the newly added
element be highlighted in the list. How do I do that?

Regards,

Jan Nordgreen

Nov 13 '05 #1
3 1553
The safest way is to store the value for the record (bound field) and
then simply make the list = to the variable.

You could also use the DLast function and set the list = to it. This
finds the last record in the table.

Nov 13 '05 #2
I tried

Me.lstconstruct iontype.Value = Me.txtedit.Valu e

but that does not select the value Me.txtedit.valu e in the list
lstconstruction type.

I also tried

Me.lstconstruct iontype.Value = DLast("construc tiontype",
"constructionty pe")

but to no avail.

I believe Me.lstconstruct iontype.Selecte d(x) = True is the way to
select an element in a list, but I donæt know how to find x in this
case.

Nov 13 '05 #3
I came up with this solution. It is not elegant, but it works:

For i = 1 To Me.lstconstruct iontype.ListCou nt
Me.lstconstruct iontype.Selecte d(i - 1) = True
If Me.lstconstruct iontype.Column( 1) = Me.txtedit Then
Exit For
End If
Next

I select the elements in the list and check their column(1) value. When
it equals the newly inserted value, I exit the loop.

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3811
by: Andrea | last post by:
Hi, I'm trying to emulate part of our client-server application as a web site so customers can use it, and I'm stuck when it comes to re-ordering items in a list. Basically we have a list of available articles ("availableItems") and a list of articles already in an issue ("selectedItems"). What I want is to be able to move articles...
1
6813
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for elements, attributes, ".", and "..", plus also the "" predicate format is supported - however, only one predicate per path step is supported, and expr must...
4
5911
by: Rithish | last post by:
Is there a way to obtain the height of a <SELECT> element dynamically, i.e. through javascript? I want to dynamically display a list box onFocus of a text box element. Also, if the list box would move out of the bottom screen area, I would want to move it up by that fraction so that it displays at the bottom of the screen. To do this, I...
13
3870
by: kevinold | last post by:
Hello everyone, I have a list of about 1600 employees that I'd like to have displayed in a form. I'd like to make the "search" for the user as easy as possible. I ran across this: http://www.barelyfitz.com/projects/filterlist/ filter that works quite well with small lists (on the site is a list of 20 names). It also works quite well in...
3
2426
by: RC | last post by:
I have a form where the user enters the Model info. The user picks the Model from either a combobox or listbox which both are filled from the Models table. If the Model type isn't in the boxes, then the user can click a button and add a new Model to the Models table. When the user clicks the "Add new Model" button, a pop-up Form opens the...
13
2329
by: Oliver Hauger | last post by:
Hello, In my html form I show a select-element and if this element is clicked I fill it per JavaScript/DOM with option-elements. I use the following code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>
4
2259
by: Ian Richardson | last post by:
Hi, The function I've put together below is a rough idea to extend a SELECT list, starting from: <body> <form name="bambam"> <select id="fred"> <option value="1">1</option> <option value="2">2</option>
1
7902
by: mike | last post by:
I have a datagridview control and a button on the windows form. I am adding a new row in button click event. When the number of rows grow, the newly added row will not be visible but a scroll bar will be shown. I want the program to highlight the newly added row and make it visible in the datagridview by scrolling to that position when a...
2
2377
by: Sebastian Fey | last post by:
hi, how do you select an option using javascript? i tried to setAttribute("selected", "disabled") to disable last selected and setAttribute("selected", "selected") for the newly selected. doesnt work :)
0
7697
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7672
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7968
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.