Solved Add and Update record continuous form from another form. (1 Viewer)

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
I have an employee Facility Item form. Please check form frmEmployeeEdit, In the Items want to click_event open another form which name is frmFacilityItemsEditor.
Q : in the form frmFacilityItemsEditor command button cmdInsertData need click to Add and Update record in the Items textbox add with separate via comma with between colors.
Q : frmFacilityItemsEditor form have a command button SELECT ALL It not work, I have some missing.
Any help will appreciate.
 

Attachments

  • Color Text.accdb
    2.8 MB · Views: 135

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:35
Joined
Aug 30, 2003
Messages
36,125
Well for starters, your function doesn't work, you need to add a space before ORDER. It currently resolves to:

",,,FROM tblFacilityItemsORDER BY ..."

Your "Select all" code doesn't make sense. You test a text field and then try to set it to True or False. Looking at it, I suspect you want to set the checkbox, but it's unbound so that won't really accomplish anything anyway. I dump all that and run a update query that sets all records at once. To do that there would need to be a field in the table.
 

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
Your "Select all" code doesn't make sense. You test a text field and then try to set it to True or False. Looking at it, I suspect you want to set the checkbox, but it's unbound so that won't really accomplish anything anyway. I dump all that and run a update query that sets all records at once. To do that there would need to be a field in the table.
I try to continues form, because I needs to add data more (if need) So, my sense the Continues form needs to a CheckBox, for selection Items.
If it was list box, can click to selection, that all
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 18:35
Joined
Aug 30, 2003
Messages
36,125
Not sure what you did. Adding a space before ORDER fixes the function:

Code:
  StrSQL = "SELECT tblFacilityItems.FacilityItems, tblFacilityItems.Id, * " & _
           "FROM tblFacilityItems" & _
           " ORDER BY tblFacilityItems.Id;"

In order to be able to select multiple records on a continuous form, the checkbox needs to be bound (have a control source) to a field in the underlying table. Any unbound control will show the same for all records. You can see that in your form by checking or unchecking any record. They all change.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:35
Joined
May 7, 2009
Messages
19,242
your form has some problem so i recreate it.
 

Attachments

  • FACILITY.zip
    48.9 KB · Views: 133

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
Thanks Arnel, nice job. I appreciated.
also I need update SQL for add or update record in the Items textbox add with separate via comma with between colors. exp: if I selected 3 items it 3 color.
 

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
your form has some problem so i recreate it.
I cant open this Continues Form to click my another Continues Form.
I try click_event, MouseMove_Event. not work.
Code:
Private Sub Items_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    DoCmd.OpenForm , "frmFacilityItems", , , , acDialog
End Sub
 

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
your form has some problem so i recreate it.
Can you give me advice how I insert data in ITEM text box from frmFacityItems form by selection.
 

Attachments

  • FACILITY.accdb
    1.3 MB · Views: 119

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:35
Joined
May 7, 2009
Messages
19,242
which Table do you want it added?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:35
Joined
May 7, 2009
Messages
19,242
try this.
 

Attachments

  • FACILITY.zip
    71.4 KB · Views: 135

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
try this.
Thanks for your reply. And I apologize for waste your times.
Please check my message #11 there I uploaded my completed DB, Open frmEmployeeEdit form and click Items field then open frmFacilityItems Form.
Here I need selected Items is added to subform frmFacilitiesSubform > in items field with comma.

Edit/
if each Items have between colors. Example : If i have selected 3 colors and it was added 3 colors [Mobile, TV, Refrigerator] with comma (if possible).
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 09:35
Joined
May 7, 2009
Messages
19,242
i already told you, you must use a Bound field for that color to appear.
it won't work on Expression.

its a lot of code for those Makeup.
 

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
i already told you, you must use a Bound field for that color to appear.
it won't work on Expression.

its a lot of code for those Makeup.
Okay, No need color, because color is not important. Just need data added with comma.
LIKE : Mobile, TV, Refrigerator. OR Mobile; TV; Refrigerator.
Thank you.
 

smtazulislam

Member
Local time
Today, 04:35
Joined
Mar 27, 2020
Messages
806
arnel I need your help Please. Just need selected data added in the fields with comma (,) OR semicolon (; )
 

Users who are viewing this thread

Top Bottom