update table with multi select

L

Len-80

I hope im in the right group please advise if i am not.

I am trying to create records for tracking items on table SDI ORDERS.
what ive done:
I have table SDI INVENTORY and table SDI ACTIVITIES, both are related to
table SDI ORDERS. with Enforced Referential Integrity. I made a form from
table SDI ORDERS. Also called SDI ORDERS. In this form i have a multi select
list called VESSLENAME. then i have Combo boxs:
"DeliverySR",CompanyName,"Activity". and Text boxes
"VESSLENAME",DeliverySR,CompanyName,Activity. I have gotten this far from
advice i read off a post by Klatuu. I have added a command button26 and on
its on click event there is code:

Private Sub Command26_Click()

Dim ctl As Control
Dim varItm As Variant

Set ctl = Me.VESSELNAME
For Each varItm In ctl.ItemsSelected

DoCmd.GoToRecord , , acNewRec
Me.txtVessleName = ctl.ItemData(varItm)
Me.txtActivity = Me.Activity
Me.txtCompanyName = Me.CompanyName
Me.txtDeliverySR = Me.DELIVERYSR
'Debug.Print ctl.ItemData(varItm)

Next varItm
Set ctl = Nothing

I am getting run-time error '2105' "you cant go to specified record."

What i want it to be able to select all vessels that were delivered to a
customers site with the Service Request number and activiy are al lthe same.
that way i can keep track of what vessles have been where. obviously i am new
at code please help!
 
L

Len-80

Len-80 said:
I hope im in the right group please advise if i am not.

I am trying to create records for tracking items on table SDI ORDERS.
what ive done:
I have table SDI INVENTORY and table SDI ACTIVITIES, both are related to
table SDI ORDERS. with Enforced Referential Integrity. I made a form from
table SDI ORDERS. Also called SDI ORDERS. In this form i have a multi select
list called VESSLENAME. then i have Combo boxs:
"DeliverySR",CompanyName,"Activity". and Text boxes
"VESSLENAME",DeliverySR,CompanyName,Activity. I have gotten this far from
advice i read off a post by Klatuu. I have added a command button26 and on
its on click event there is code:

Private Sub Command26_Click()

Dim ctl As Control
Dim varItm As Variant

Set ctl = Me.VESSELNAME
For Each varItm In ctl.ItemsSelected

DoCmd.GoToRecord , , acNewRec
Me.txtVessleName = ctl.ItemData(varItm)
Me.txtActivity = Me.Activity
Me.txtCompanyName = Me.CompanyName
Me.txtDeliverySR = Me.DELIVERYSR
'Debug.Print ctl.ItemData(varItm)

Next varItm
Set ctl = Nothing

I am getting run-time error '2105' "you cant go to specified record."

What i want it to be able to select all vessels that were delivered to a
customers site with the Service Request number and activiy are al lthe same.
that way i can keep track of what vessles have been where. obviously i am new
at code please help!




Hi all i was able to fix this issue. Turns out my combo boxes on the form had to be unbound to work correctly. Case Closed
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top