468,167 Members | 1,956 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,167 developers. It's quick & easy.

Put data into subform with click on List Box items

58 32bit
hi buddies.

i am working on MS Access Purchase system . i made a form with a subform name PurchaseForm contain ID, ItemName, ItemQuantity, ItemPrice, TotalPrice and i made and Item Listbox name ItemBox contain items names.
i want to click the item name in listbox and it fill into subform itemName. as i click the item fill in box and another row made.

how i can do this.

i tried like this on click even on ItemBox like
forms!PurchaseForm.ItemName = me.ItemBox.Column(1)

but its not working
Mar 9 '21 #1

✓ answered by NeoPa

I would add that it may be very helpful for you to see Forms and Reports as being like windows - I mean the ones with glass you can see through.

None of the lovely scenery outside of your house is contained in the window itself. It merely allows us to see it nicely.

The same is true of Forms and Reports. Certainly, there are trimmings you can add to the window which you'll see every time you look at it but it doesn't store the outside. If you want data to be stored then you have to save it in a table somewhere. When the data's safely in the table it's then visible via your Form or Report.

8 2964
isladogs
232 Expert 128KB
Assuming you really do want the second column data from the list box, then possibly this
Expand|Select|Wrap|Line Numbers
  1. Me.PurchaseForm.Form.ItemName = Me.ItemBox.Column(1)
You may find this link useful Reference Controls on subforms
Mar 9 '21 #2
NeoPa
32,042 Expert Mod 16PB
I would add that it may be very helpful for you to see Forms and Reports as being like windows - I mean the ones with glass you can see through.

None of the lovely scenery outside of your house is contained in the window itself. It merely allows us to see it nicely.

The same is true of Forms and Reports. Certainly, there are trimmings you can add to the window which you'll see every time you look at it but it doesn't store the outside. If you want data to be stored then you have to save it in a table somewhere. When the data's safely in the table it's then visible via your Form or Report.
Mar 10 '21 #3
ZKAHADI
58 32bit
this formula worked but i cant add new item to next row.
i tried like

Me.PurchaseForm.Form.ItemName = Me.ItemBox.Column(1)
docmd.gotorecord , , acNewRecord

but unfortunately this not work too
Mar 11 '21 #4
NeoPa
32,042 Expert Mod 16PB
I'm sorry. With so little information in your response I have no idea what you're trying to say.
Mar 12 '21 #5
ZKAHADI
58 32bit
when i click the item listbox to put data into subform it updated but if i again click then new row is not create
the same row data is changing.

Attached Images
File Type: jpg Untitled.jpg (70.3 KB, 47 views)
Mar 13 '21 #6
NeoPa
32,042 Expert Mod 16PB
I'm still very unclear but perhaps if you tried putting the first line after the second it might work. Again, I have far too little understanding of what you're talking about to be sure, but it might be worth a try.
Mar 13 '21 #7
ZKAHADI
58 32bit
let me explain....

when i click on listbox the item name and price added in subform first row.
if i click again on itembox the item not going add in new row.
it update in old row again.

i want if i click the item name the item add in first row on again click item added in new row same one by one new row made.
Mar 15 '21 #8
isladogs
232 Expert 128KB
If I understand you correctly, the first record in the subform will be overwritten because you haven't moved off that before selecting another item from your listbox.
Mar 15 '21 #9

Post your reply

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

Similar topics

5 posts views Thread by Peter Collinson | last post: by
2 posts views Thread by Unknown User | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by kamranasdasdas | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.