-
May 18th, 2022, 04:14 AM
#1
Thread Starter
New Member
[RESOLVED] How to handle events of subform cells at runtime in Access
Hello there,
I was asked to create user input interfaces for an Access database and now I'm stuck on how to handle subform events specifically for cells.
I have a subform named dgvRecipesList (marked with a red square) that is based on data gathered from a table named tbReceita:
The subform, at the form's load event has the property AllowEdits disabled.
What I'm trying to achieve is, the user must only be able to edit cell values from the column identified as QT.
The button below the subform, with the text Editar, will only be enabled when the user selects any cell from the column QT.
Then, when the user clicks the button with the text Editar, the subform's AllowEdits property will be enabled and the text of the button will change to Guardar (which means save).
After this, the user can change the desired cells' value and when done clicks the button that now has the text Guardar, saving the new values into the table, disabling the subform's AllowEdits property and, finally, reverting the button text to Guardar.
The problem I have at hand is that I have no way of handling events for the subforms cells, at least not directly from the designer, so how can I achieve this?
Last edited by Technical; May 18th, 2022 at 05:12 AM.
-
May 18th, 2022, 08:03 PM
#2
Re: How to handle events of subform cells at runtime in Access
First... Is this a VB.Net question??? Is this an Access VBA question???
The two aren't interchangeable - they're different technologies, and the answer to your question depends on the answer to those questions.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
May 19th, 2022, 12:59 AM
#3
Re: How to handle events of subform cells at runtime in Access
.paul. is right to ask that question but, based on the name "dgvRecipesList", I'm going to go out on a limb and guess that what you're calling a "subform" isn't (because there's no such thing in WinForms) and it's just a DataGridView control. If what you're saying is that you want only certain columns in a DataGridView to be editable then set the ReadOnly property of those columns to False and all others to True. It's just a property like any other so you can set it in the designer (if your columns are created there) or at run time.
-
May 19th, 2022, 04:01 AM
#4
Thread Starter
New Member
Re: How to handle events of subform cells at runtime in Access
I'm sorry... I don't know what happened. I could've sworn I created the thread under the Visual Basic 6 and Earlier category.
Any chance the thread can be moved under that category?
My issue is related to access controls, so it's specific to a subform with the name dgvRecipesList. I gave it that name, because it's similar to a datagridview on vb.net.
-
May 19th, 2022, 04:57 AM
#5
Re: How to handle events of subform cells at runtime in Access
You can click the Report Post icon under your own post to send a message to the mods and ask for it to be moved. The question where to move it to. Is this a VB6 question or a VBA question?
-
May 19th, 2022, 05:26 AM
#6
Thread Starter
New Member
Re: How to handle events of subform cells at runtime in Access
Originally Posted by jmcilhinney
You can click the Report Post icon under your own post to send a message to the mods and ask for it to be moved. The question where to move it to. Is this a VB6 question or a VBA question?
It's a VBA question.
I just reported the post.
Also, I just found out the solution to the problem and will post it as soon as the thread is moved.
Last edited by Technical; May 19th, 2022 at 05:29 AM.
-
May 19th, 2022, 08:43 AM
#7
Re: How to handle events of subform cells at runtime in Access
Moderator Actions: Moved to Office Development which is for all questions regarding Microsoft Office Automation. This can include VSTO, VSTA, and VBA questions.
-
May 19th, 2022, 09:02 AM
#8
Thread Starter
New Member
Re: How to handle events of subform cells at runtime in Access
I found out that the problem was all about the way I created the subform.
When I created the subform I linked it directly to the tbReceitas table without any kind of design "behind it" and tables don't have events.
So, all I did was delete the subform I had a created a new one that would link to fields and from there I can have access to the fields events and properties.
Thanks for the time everyone.
Also, thanks dday9 for moving the thread to its proper place.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|