473,654 Members | 3,097 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 3419
On Mon, 12 Jan 2004 21:02:19 -0500, "Robin S." <la*******@hotm ail.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*******@hotm ail.com> wrote in message
news:Kk******** ************@ne ws20.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>.Re query 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*******@hotm ail.com> wrote in message
news:Kk******** ************@ne ws20.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******** ***********@new ssvr31.news.pro digy.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******@sympa tico.ca> wrote in message
news:Gp******** ************@ne ws20.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>.Re query 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*******@hotm ail.com> wrote in message
news:Kk******** ************@ne ws20.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*******@hotm ail.com> wrote in message
news:6i******** *************@n ews20.bellgloba l.com...

"Wayne Morgan" <co************ *************** @hotmail.com> wrote in message news:lw******** ***********@new ssvr31.news.pro digy.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
4201
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 Set rs = Me.RecordsetClone rs.Find "=" & lngContractID If Not rs.EOF Then Me.Bookmark = rs.Bookmark I must site the Heisenberb Uncertainty Principal here, as it
1
3330
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 the list box (items they wish inserted into the table), or they can select items in the list box to delete (from the table). Once they have finished making any changes, they are to click a SAVE button to actually commit the changes to the database....
2
2340
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 previous form. For instance, let's pretend that I need to choose equipment - Drill XX10. After I press the button by side of text box, which I need to fill, the onclick even calls the form where I can either input new entry or select existing...
18
13591
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 will relate to the same person - but the subform data will not be 'linked' to the main form. I want to have one Cancel button for all the undo operations on all the subforms, so the individul subform's Public Sub, Form_Cancel will be called...
11
6583
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 where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
4
3169
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. Tables: (abbreviated) TblDivision DivisionID
8
12088
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 combobox. What is the solution? Thank you in advance.
10
12691
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 certain that MyVar will be set to the key-field value that was created when the Append query ran. Now, there are other ways to do it - I know - that will ensure you 'nab' the correct record. But I was wondering
1
3595
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 a combo box with a Select query to select one of the records in Table A. (The parent form is bound to Table A.) I want to be able to first, view all of the corresponding records from Table B and then second, give an option for editing these...
0
8815
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8707
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8593
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5622
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
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
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.