Need help editing data in subform (1 Viewer)

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
Hello All,
For over a week I have been reading this board and google etc, still have not been able to come up with a solution to my problem. I sincerely hope someone out here could give me a clue. In my subform I have a list of materials and weights, price etc. This is gathered from a form to a table tblDocketBuy buy choosing a Material. However, at a later stage I have to be able to enter the Empty weight [E_Weight] into one of the records of the subform.

I attach the app for perusal... any help greatly appreciated..
 

Attachments

  • 3001-1000.zip
    374.8 KB · Views: 86

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
You haven't really explained what you're trying to achieve here. Perhaps some screenshots would aide your explanation too.
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
You haven't really explained what you're trying to achieve here. Perhaps some screenshots would aide your explanation too.

Sorry, thought the application would show..
Here is the screen shot, I have created record vbaInet, but now need to enter the Empt weight. Since I did not know that when I created the record.

Eventually the scale will be connected to this.. But manual input would get me a great end..
 

Attachments

  • vbaInet1.jpg
    vbaInet1.jpg
    94 KB · Views: 117

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
I still can't make out any head or tail from what you're trying to do. Could you explain in more detail.
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
The application operates a Weighbridge, A driver registers in the office, a docket is created using the form frmTouchscreen, it registers customer name, vehicle license, haulier, sales rep and weighbridge operator. Then the operator switches to frmMultiTouchscreen where the Unloaded materials are registered. Some vehicles carry more materials, so the driver unloads more then one time. The first time he tells he has Aluminium, the Full_Weight is registered in the table, he drives off and a second vehicle comes with other material. A new docket is created and same as above. Sometimes there are 6 vehicles in the yard. The first vehicle comes back on the bridge and now his Empty Weight needs to be recorded. The driver tells he is now going to off load Copper this time. So a second record connected to the same docket number is created. Registering Copper and a Full Weight, he drives off and after three other vehicles have been weighed, he comes back to have his Empty Weight recorded.
I can't figure out how to record his Empty Weight because both in query or using a form, the subform does not accept any input.
Hope this gives a clearer picture of my problem..
Great you are willing to look at it..
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
I didn't really need to know the full process ;)

Have you thought about using an Update query?
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
That wasn't the full process.. ;)
Thought about that but don't know where to begin so I better start reading.. unless someone has a bright idea how to select a record of the subform.. and could put me in the right direction.. Well you did anyway..
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
Look into this:
Code:
CurrentDb.Execute "UPDATE TableName SET [NumberField1] = " & Me.txtBox1 & ", [TextField2] = '" & Me.txtBox2 & "' WHERE ID = " & Me.ID & ";"
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
Look into this:
Code:
CurrentDb.Execute "UPDATE TableName SET [NumberField1] = " & Me.txtBox1 & ", [TextField2] = '" & Me.txtBox2 & "' WHERE ID = " & Me.ID & ";"

Going on site now, but thank you very much for the hint.. Will look at it this afternoon and tonight.. Probably need some time to check it out but keep you posted on the result.. Great job..:)
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
Look into this:
Code:
CurrentDb.Execute "UPDATE TableName SET [NumberField1] = " & Me.txtBox1 & ", [TextField2] = '" & Me.txtBox2 & "' WHERE ID = " & Me.ID & ";"

Works like a charm vbaInet, this is the code;
Code:
CurrentDb.Execute "UPDATE TblDocketBuy SET [E_Weight] = " & Me.TxtWeight & ", [B_Price] = " & Me.TxtPrice & " WHERE ID = " & Me.ID & ";"

One small problem however, my main form now says record set is not up-datable for some reason. So I removed both Full-Weight and Empty_Weight that were bound on the main form, Now I can make entries, since done this I can only select dockets that were there. New dockets will not select from the listbox where old dockets can be selected and materials added..
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
One small problem however, my main form now says record set is not up-datable for some reason. So I removed both Full-Weight and Empty_Weight that were bound on the main form, Now I can make entries, since done this I can only select dockets that were there. New dockets will not select from the listbox where old dockets can be selected and materials added..
The code provided would have no effect on your form's recordset not being updateable. You have added some more tables or certain calculations on the record source which is preventing it from being updateable.

Here's a list of why a recordset is unupdateable:

http://allenbrowne.com/ser-61.html
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
The code provided would have no effect on your form's recordset not being updateable. You have added some more tables or certain calculations on the record source which is preventing it from being updateable.

Here's a list of why a recordset is unupdateable:

http://allenbrowne.com/ser-61.html

Thanks for the hint, this will give me some to check, will get back with the result so other might enjoy the solution too..:)
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
Thanks vbaInet, this link made it possible to seriously improve my skills and application..
 

Marinus

I'm learning... :)
Local time
Today, 20:38
Joined
Jun 16, 2010
Messages
140
Just asked a new question as new treat as this problem was more then resolved by you it helped me to make the app far more efficient..
Well done..
 

vbaInet

AWF VIP
Local time
Today, 20:38
Joined
Jan 22, 2010
Messages
26,374
Happy to hear.

Plus I replied to your new thread :D
 

Users who are viewing this thread

Top Bottom