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

New record from listbox selection

stonward
145 100+
Hi,

I'm (now) a moderately experienced Access developer, but I'm currently stuck with a problem i can't seem to get over.

I have a filtered listbox of products on a form and I want to use the selection (single select) of the listbox to start a new record in a subform below it.

Can anyone help? I would be muchly grateful.

Thanx folks,

Roy, WSM.
Jul 3 '07 #1
7 1933
Rabbit
12,516 Expert Mod 8TB
Hi,

I'm (now) a moderately experienced Access developer, but I'm currently stuck with a problem i can't seem to get over.

I have a filtered listbox of products on a form and I want to use the selection (single select) of the listbox to start a new record in a subform below it.

Can anyone help? I would be muchly grateful.

Thanx folks,

Roy, WSM.
Well, you could use the after update event or the on click event of the listbox. That would then fill in the fields of the subform. You want to consider what happens if they make accidental clicks and such.
Jul 3 '07 #2
stonward
145 100+
Thanks, Rabbit,

...working on your proposal now - will let you know!

PS...can you tell me what 'PM' ing is?!
Jul 4 '07 #3
stonward
145 100+
I was using the dbl_Click event anyway, along with a whereCondition and addNew statement.
Tried the on_click event with a macro (goToRecord(new)) but keep getting a message that the object (subform) is closed (oh no it isn't). Even putting a SelectObject in front doesn't cure this. I'm going to continue to battle this to the end, but any further help would be great for my ulcers!

Thanks again,

Stonward Roy.
Jul 4 '07 #4
Rabbit
12,516 Expert Mod 8TB
I was using the dbl_Click event anyway, along with a whereCondition and addNew statement.
Tried the on_click event with a macro (goToRecord(new)) but keep getting a message that the object (subform) is closed (oh no it isn't). Even putting a SelectObject in front doesn't cure this. I'm going to continue to battle this to the end, but any further help would be great for my ulcers!

Thanks again,

Stonward Roy.
Here's the thing about subforms, they're not considered their own object. So you can't use the go to new record on the subform if you're not in the form.

PM is private messaging.

You could try the go to new record on Forms![Main Form]![Subform Name].Form but I don't think that will work.
Jul 5 '07 #5
stonward
145 100+
Gonna keep trying - tho' another way may be easier, eh?!

Thanx for all your help, folks.

Roy.
Jul 9 '07 #6
damonreid
114 Expert 100+
This might be of some help. The below code inserts a value into another table on command.


Expand|Select|Wrap|Line Numbers
  1.    Dim MyRST As Recordset
  2.     Set MyRST = CurrentDb.OpenRecordset("TABLE NAME", dbOpenDynaset)
  3.                 With MyRST
  4.                     .AddNew
  5.                     ![FIELD NAME] = Me.CONTROL.Value
  6.                     .Update
  7.     End With
You can then set the command double click to open a new form with this record? I know it isn't what you wanted but might be a step in the right direction.
Jul 9 '07 #7
stonward
145 100+
Cool. Thanks for that - I reckon that could be the answer.

Thanks again to all who helped!

Stonward Roy
Jul 10 '07 #8

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

Similar topics

1
by: SuffrinMick | last post by:
Hi All I have two tables: tblRecords and tblOptions. tblRecords consists of RecordID (autonumber), Record (text) and Option (text record of options chosen) fields tbloptions consists of...
2
by: (Pete Cresswell) | last post by:
Seems like I've been here before, but can't find anyting in Google. I've got two list boxes on a form. Seems to me like the inactive ListBox's selection rectangle should be something like...
6
by: Dan Bass | last post by:
If you look at explorer, right clicking on a file, first selects the file, then throws up the context menu relating to that selection. With a Windows ListBox control and a simple context menu,...
6
by: MLH | last post by:
When the vehicle entry form (frmVehicleEntryForm) first opens, the additional owner SubForm control (frmAddnlOwnrListSubForm) is enabled. You can click on it and it will accept the focus. But after...
0
by: Sanjin | last post by:
I have populated listbox with data from the datatable. I binded SelectedValue to the another datatable - i.e. selection result (with VS 20005 wizard). Selection result datatable has...
9
by: zdrakec | last post by:
Hello all: Clearly, I'm not getting it! Here is the scenario: On a web page, I have two list boxen and a text box. The first listbox is populated at page load time (if it is not a postback)....
4
by: kimiraikkonen | last post by:
Hi, I have a odd but a known question about listbox. I know listbox control can provide multi-select, multi-extendend selections. But i wonder if this selection type belongs to them or it has...
8
by: bluemoon9 | last post by:
Does anyone know how to write a code to promt the selection at the last record in the list box?. I have this code below in the "On Click" event, when user click on the code, it close a form, requery...
2
by: lhsiber | last post by:
I am new to access and am having a problem with filtering. Here is a little bit of my setup: I have a main form that has a listbox so that users can choose one or many groups in which to display...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.