By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,715 Members | 1,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,715 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.