Form data to table issue (1 Viewer)

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
I have table and and i generate form from that table. There is a Field called Spare Parts and Control source is selected as Spare Parts. But I want to make =[USE SPAREPARTS].[Form]![Text41] to that control source. if i eter this the data not store in the table. any one know how to fix it
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:32
Joined
May 7, 2009
Messages
19,245
what is [USE SPAREPARTS]? a form?
i don't understand the requirement.
you can try adding an Unbound textbox to your form.
on the unbound textbox controlsource:

=[Forms]![USE SPAREPARTS]![Text41]
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
what is [USE SPAREPARTS]? a form?
i don't understand the requirement.
you can try adding an Unbound textbox to your form.
on the unbound textbox controlsource:

=[Forms]![USE SPAREPARTS]![Text41]
What i am asking is if i remove the table field in Control source and add a expression to it. How can i submit that value to table.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:32
Joined
May 7, 2009
Messages
19,245
you can Open a Query and update your table with the value.
if the value is already saved on another table, then you don't need to
save it again (reduntant/ not normalized).
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
you can Open a Query and update your table with the value.
if the value is already saved on another table, then you don't need to
save it again (reduntant/ not normalized).
IF I RUN A UPDATE QUERY ON FORM WHICH ENABLED DATASHEET VIEW. QUERY DIDN'T GET DATA FROM THE FORM FIELDS AND POP UP TO ENTER DATA TO RUN QUERY WHY?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:32
Joined
May 7, 2009
Messages
19,245
what is the SQL of your update query?
what version of ms access do you have?
 

jdraw

Super Moderator
Staff member
Local time
Today, 13:32
Joined
Jan 23, 2006
Messages
15,379
Further to arnelgp's request, readers need more info to help put your posts into context. Code related to your form and query or a copy of the database would be helpful.
Can you tell us in plain, simple English (no database jargon) - what are you trying to accomplish?
I'm attempting to get you to describe the "business issue" underlying your request.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 12:32
Joined
Feb 28, 2001
Messages
27,188
What i am asking is if i remove the table field in Control source and add a expression to it. How can i submit that value to table.

You are asking about using an unbound field but storing the result. Yes, this is possible but doing this is making more work for yourself and it also avoids the primary strength of Access - to automatically store items bound to a form.

I believe there is a misunderstanding here, but I haven't identified its nature yet. So... let's say that you want this. OK, acknowledged, it is what you want and I assure you it is possible. But WHY do you want to do it this particular way, which we see as unusual?

What we see is this: You could leave this as a field bound to a control and simply enter a new, different value in that control. That new value would be saved with the rest of the record when you save the form's current record anyway.

You want to do something other than the normal Access style of doing things, so you must have a reason as to WHY you wish to do it this way. Can you explain that reason to us? Because right now we don't see why you want to go out of your way to do something that Access normally does anyway.
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
hI THIS IS ANOTHER ISSUE IN FORM DATA SHHET VIEW. IF I SELECT VALUE FROM DATASHEET VIEW DROPDOWN THE ID IS GOING TO SECONDS 3RD ROW ALSO
1641927449974.png
 

CJ_London

Super Moderator
Staff member
Local time
Today, 18:32
Joined
Feb 19, 2013
Messages
16,614
What i am asking is if i remove the table field in Control source and add a expression to it. How can i submit that value to table.
If I've understood you correctly, in the main form before update event put something like

myfield=[USE SPAREPARTS].[Form]![Text41]

This assumes text41 is the name of a control on a subform to the main form.

If I've guessed correctly (I'm assuming text41 is the name of a control summing or counting a value) then I have to say that storing calculated values of this nature is a bad idea.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 13:32
Joined
Feb 19, 2002
Messages
43,275
When you have a continuous or ds view form and you have an unbound field, when you put a value into that unbound field, every visible row will show the exact same value. That is because there is only one set of properties for any form and when you are looking at a continuous or DS form, you are looking at multiple instances of a single form all sharing one set of properties. So, only bound fields will show different values since they get the data from table fields.

I don't think any of us still understand what problem you are trying to solve. We're all guessing. Please try again using business terms to tell us why you can't use a bound form.
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
what is the SQL of your update query?
what version of ms access do you have?
Hi

I add form with datasheet view to another form. and add this code (Marco applyfiltrer) to search data on table through form.

[ACT ID] Like "*" & [Form]![MAINTENANCE COST]![Combo54] & "*"

It worked perfectly in form view. Then I add thiss code with my sub form. The subform is in datasheet mode
[ACT ID] Like "*" & [Form]![MAINTENANCE COST]!USE SPAREPARTS].[Form]![Combo54] & "*"

This doesent work.
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
Hi

I add form with datasheet view to another form. and add this code (Marco applyfiltrer) to search data on table through form.

[ACT ID] Like "*" & [Form]![MAINTENANCE COST]![Combo54] & "*"

It worked perfectly in form view. Then I add thiss code with my sub form. The subform is in datasheet mode
[ACT ID] Like "*" & [Form]![MAINTENANCE COST]!USE SPAREPARTS].[Form]![Combo54] & "*"

This doesent work.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 01:32
Joined
May 7, 2009
Messages
19,245
what is [USE SPAREPARTS]? is it a subform or another form?
you try all possible combi (maybe you'll win the lotto):


[ACT ID] Like "*" & [Forms]![MAINTENANCE COST]![USE SPAREPARTS].Form![Combo54] & "*"
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
what is [USE SPAREPARTS]? is it a subform or another form?
you try all possible combi (maybe you'll win the lotto):


[ACT ID] Like "*" & [Forms]![MAINTENANCE COST]![USE SPAREPARTS].Form![Combo54] & "*"
Main form is Maintenance cost
Use spare Part is another form but i added as a sub form of maintenance cost on datasheet view mode.
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
There is table called ProductCost. I want to get All products Total Product Cost to a Form field. Form is not connected with table. How to do that
 

Bandara

Member
Local time
Today, 23:02
Joined
Apr 17, 2020
Messages
60
what is [USE SPAREPARTS]? is it a subform or another form?
you try all possible combi (maybe you'll win the lotto):


[ACT ID] Like "*" & [Forms]![MAINTENANCE COST]![USE SPAREPARTS].Form![Combo54] & "*"
There is table called ProductCost. I want to get All products Total Product Cost to a Form field. Form is not connected with table. How to do that
 

Users who are viewing this thread

Top Bottom