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

How to select and go to record from a list box?

Good day
I need some help to do the following.
*
I am busy writing a program for inventory management, dealing with the operators, customers, suppliers etc.
*
I have two foms called: "OperatorDetails" and "EditOperator"
*
On the form "OperatorDetails" I have a search button and when clicked it opens "EditOperator" showing all the operators in the database.
*
On the form "EditOperator" I have a listbox containing all the information on the underlying table called "AdmOperators".
The table "AdmOperators" have fields like "Operator (PK and is NOT a autonumber),Location, IsAdministrator etc.
*
So all that I want to happen is that when I double click on a record in the listbox, it must take that specific "Operator" and fill it into a textbox on the form "OperatorDetails" called "txtEditOperator", then go to that specific record.
*
I know that I could use like a combobox in the "OperatorDetails" form, but I wat it this way for some other reasons which is not applicable now.
*
If you think you can help me, please reply as soon as possible.
*
Thanking you in advance.
*
Ryno
Jan 21 '11 #1
1 1996
NeoPa
32,556 Expert Mod 16PB
Does it help to know that you can pass an object reference to a form if you design that form with a public function to support that? With a reference to the calling form you can write your code to manipulate that form from within your called form. It can also be done with class objects (which is what I use for all my forms), but that's a little more involved and I won't go into that here without any specific interest being shown in that approach.

I include below the basics of what's required to pass the calling form to the called form in your project :
Calling Form
Expand|Select|Wrap|Line Numbers
  1. Call DoCmd.OpenForm("frmCalled", , , stLinkCriteria)
  2. Call Forms("frmCalled").PubProc(CallingForm:=Me)
Called Form
Expand|Select|Wrap|Line Numbers
  1. Option Compare Database
  2. Option Explicit
  3.  
  4. Private frmCallingForm As Form
  5.  
  6. '... other code probably
  7.  
  8. Public Sub PubProc(CallingForm As Form)
  9.     Set frmCallingForm = CallingForm
  10. End Sub
The code you would use to control any of the objects in the Calling Form from within the Called Form would refer to the Private Form object frmCallingForm and should probably check that it is not set to Nothing before use (just in case).
Jan 21 '11 #2

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

Similar topics

4
by: Eric Freeman | last post by:
Is there any way in Postgres to SELECT a list of table names from inside of a C program using ECPG? Something similar to SELECT current_user that will give you all of the tables in the database...
4
by: VK | last post by:
I'm looking for autoexpand <select> list onfocus and collapse it back onselect/onblur (the list is select-one type) I know it is not possible directly, but I've seen here a hack by changing...
6
by: AA Arens | last post by:
Hi, I have a database with 2 main forms. Contacts and companies. I share the base with two others via LAN. On the companies form I have buttons to navigate throught the records (>400). We are...
3
by: Beholder | last post by:
I hope that someone can help me with the following: Short background explenation: I have a shrfepoint page (newform.aspx) in a item list. On this page is a lookup column that displays a lookup...
5
by: =?Utf-8?B?bWNhdWxpZmZl?= | last post by:
I have an old application ( pre-VB5) that I need to add a select/option list to. This is an edit program so the values for the form will be retrieved from a database. How do I set the value of...
3
by: reverendjb | last post by:
I'm stumped on this one, so here goes.... I have 2 tables project and assignment they are linked by the field proj_id where proj_id is the primary key of project and a foreign key in...
2
by: Shivajirp | last post by:
I have table in which Shift no, Start time. End time. if start time of shift is 6pm and end time of shift is 6 am then I want to select record between start time and end time.I need query to selct...
0
by: Andrus | last post by:
How to create select columns list dynamically in DLinq ? I want to create something like Console.WriteLine("Enter list of columns to return, separated by commas:"); string list =...
1
by: rk2008 | last post by:
Hi, I'm using following code to select a record on a form from dropdown list and I'm using MSSQL ODBC linked tables inside MS Access: Private Sub cboFind_AfterUpdate() Dim strCriteria As String...
8
by: simonc88 | last post by:
Hi guys hope you can help with this one, I have a list box being fed by a table, the list box has 3 columns with the first being an ID number and displays the records that are saved in the table....
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
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,...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.