473,508 Members | 2,357 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using one form to select the current record in another..

Originally I wanted a list box which selects which record is the current one
within the same form. Easy enough until Access takes a dump when one is
deleted and then someone tries to select it in the list box (same session).
I can't get the repaint to work at all.

So, what about a pop-up that shows a list box. The user selects which record
should be current. This pop-up then closes and the underlying form has the
selected record ready to be edited.

I'm sure this is a basic question but I'm a novice.

Thanks for any hints.

Regards,

Robin
Nov 12 '05 #1
6 3399
On Mon, 12 Jan 2004 21:02:19 -0500, "Robin S." <la*******@hotmail.com>
wrote:
Originally I wanted a list box which selects which record is the current one
within the same form. Easy enough until Access takes a dump when one is
deleted and then someone tries to select it in the list box (same session).
I can't get the repaint to work at all.

So, what about a pop-up that shows a list box. The user selects which record
should be current. This pop-up then closes and the underlying form has the
selected record ready to be edited.

I'm sure this is a basic question but I'm a novice.

Thanks for any hints.

Regards,

Robin

You really should use a combo box, not a list box, to find the record
you wish on your form.
If you use the Combo Wizard to create the combo box for you, select
the 3rd option on the first page of questions, something like 'Find a
record ... etc.'

Place the combo in the Form header (or Footer). Leave it unbound.
Set it's AutoExpand property to yes.

As you start to enter the recordID, the combo will go to the first
matching record. When the RecordID is correct, click Enter, and the
form will display that record.
*** Use requery when working with list/combo boxes, not repaint. ***
--
Fred

Please reply only to this newsgroup.
I do not reply to personal e-mail.
Nov 12 '05 #2
Repaint redraws the form on the screen, it doesn't do anything with the
data. Do a requery on the listbox after a delete to make sure it has
up-to-date information.

In the form's AfterDelConfirm event try

If Status = acDeleteOk
Me.lstMyListbox.Requery
End If

--
Wayne Morgan
Microsoft Access MVP
"Robin S." <la*******@hotmail.com> wrote in message
news:Kk********************@news20.bellglobal.com. ..
Originally I wanted a list box which selects which record is the current one within the same form. Easy enough until Access takes a dump when one is
deleted and then someone tries to select it in the list box (same session). I can't get the repaint to work at all.

So, what about a pop-up that shows a list box. The user selects which record should be current. This pop-up then closes and the underlying form has the
selected record ready to be edited.

I'm sure this is a basic question but I'm a novice.

Thanks for any hints.

Regards,

Robin

Nov 12 '05 #3
Ultimately it's how you want it to work and look. You're idea would work,
but would a combobox be simpler? Add the statement <comboxName>.Requery to
it's GotFocus event, and each time someone tries to pick something from the
list, it's contents will be refreshed, adding new or deleting entries from
other users actions. This still won't reflect changes that occur while the
combobox has the focus (neither will your form idea), but it cuts down the
time span in which the change could happen.

Mike Storr
www.veraccess.com

"Robin S." <la*******@hotmail.com> wrote in message
news:Kk********************@news20.bellglobal.com. ..
Originally I wanted a list box which selects which record is the current one within the same form. Easy enough until Access takes a dump when one is
deleted and then someone tries to select it in the list box (same session). I can't get the repaint to work at all.

So, what about a pop-up that shows a list box. The user selects which record should be current. This pop-up then closes and the underlying form has the
selected record ready to be edited.

I'm sure this is a basic question but I'm a novice.

Thanks for any hints.

Regards,

Robin

Nov 12 '05 #4

"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:lw*******************@newssvr31.news.prodigy. com...
Repaint redraws the form on the screen, it doesn't do anything with the
data. Do a requery on the listbox after a delete to make sure it has
up-to-date information.

In the form's AfterDelConfirm event try

If Status = acDeleteOk
Me.lstMyListbox.Requery
End If


Wayne,

Access didn't like the

If Status

argument. Something about "expecting Then or Go To"

Thanks to all for the suggestions. I will try my best to implement them...

Regards,

Robin
Nov 12 '05 #5
Mike,

The .requiry worked perfectly. Thanks for the help.

Regards,

Robin
"Mike Storr" <st******@sympatico.ca> wrote in message
news:Gp********************@news20.bellglobal.com. ..
Ultimately it's how you want it to work and look. You're idea would work,
but would a combobox be simpler? Add the statement <comboxName>.Requery to
it's GotFocus event, and each time someone tries to pick something from the list, it's contents will be refreshed, adding new or deleting entries from
other users actions. This still won't reflect changes that occur while the
combobox has the focus (neither will your form idea), but it cuts down the
time span in which the change could happen.

Mike Storr
www.veraccess.com

"Robin S." <la*******@hotmail.com> wrote in message
news:Kk********************@news20.bellglobal.com. ..
Originally I wanted a list box which selects which record is the current

one
within the same form. Easy enough until Access takes a dump when one is
deleted and then someone tries to select it in the list box (same

session).
I can't get the repaint to work at all.

So, what about a pop-up that shows a list box. The user selects which

record
should be current. This pop-up then closes and the underlying form has the selected record ready to be edited.

I'm sure this is a basic question but I'm a novice.

Thanks for any hints.

Regards,

Robin


Nov 12 '05 #6
You're right, I left the "Then" out, it should have been

If Status = acDeleteOk Then
Me.lstMyListbox.Requery
End If
--
Wayne Morgan
MS Access MVP
"Robin S." <la*******@hotmail.com> wrote in message
news:6i*********************@news20.bellglobal.com ...

"Wayne Morgan" <co***************************@hotmail.com> wrote in message news:lw*******************@newssvr31.news.prodigy. com...
Repaint redraws the form on the screen, it doesn't do anything with the
data. Do a requery on the listbox after a delete to make sure it has
up-to-date information.

In the form's AfterDelConfirm event try

If Status = acDeleteOk
Me.lstMyListbox.Requery
End If


Wayne,

Access didn't like the

If Status

argument. Something about "expecting Then or Go To"

Thanks to all for the suggestions. I will try my best to implement them...

Regards,

Robin

Nov 12 '05 #7

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

Similar topics

17
4170
by: Danny J. Lesandrini | last post by:
The following code works with a standard MDB to navigate to a particluar record (with a DAO recordset, of course) but it's giving me problems in an ADP I'm working on. Dim rs As ADODB.Recordset...
1
3316
by: Ryan | last post by:
Hello, I have a quick question (I hope). I have a form with a combo box and a multi-selection list box. The list box is based on a query. Users can select values from the cmbobox to add to...
2
2336
by: alpha_male | last post by:
Hello What way would be the best of selecting value by using another form? I use command button wizard to open another form. But in what way I can return the current record's value to the...
18
13560
by: Darryl Kerkeslager | last post by:
I don't do much with subforms - in fact I've deliberately avoided them - but .... I have a tab control that will contain several subforms, each bound to a separate table, and each table/subform...
11
6551
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
4
3155
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
8
12066
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...
10
12658
by: MLH | last post by:
Suppose, in a multi-user environment, you have append query SQL in a VBA procedure that looks like INSERT INTO MyTable... and the next line reads MyVar=DMax("","MyTable... You can never be...
1
3579
by: troy_lee | last post by:
I have a table (Table A). It has one field, a PK. It is in a 1:M with another table (Table B). I am having trouble with a form/subform setup to view the 1:M records. On the parent form, there is...
0
7224
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
7323
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,...
1
7039
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
5626
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,...
1
5050
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4706
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
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
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 ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.