Question

Does microsft office access have this function when i select the row from the subform, the selected data from EmpName, ComputerName & ProductName will automatically fill into my 2 textbox at the top right and the product Name will be another combobox to select product.

Another thing is, Is it possible to do CRUD upon selection in subform?

what kind of tag should i goggle for to answer my question? I tried a lot of different tags aldy but none answers my question. Access Form

Was it helpful?

Solution

The short answer is yes. ;) You can do all those things. I well remember the day I realized that I could do anything in MS Access. (now be kind this was the first experience I had in programming)

You can reference Parent controls from subforms with this convention Me.Parent.control

For example if the Parent form has a text box named txtEmployeeId then on the Click event of a text box in the sub form you could have this code.

Me.Parent.txtEmployeeID = Me.txtEmployeeID

You can quickly extend this code to do whatever you need ie.

Me.Parent.txtComputerName = Me.ComputerName
Me.Parent.cboProductName = Me.ProductName

CRUD is a statement used in web development which seems to be where you are coming from. Access is CRUD in many ways (unless you start getting complicated) In the example above, once you navigate off the parent record with the record selector or close the form, the record is saved without any code being written. Once you start playing around with unbound controls then it becomes necessary to write code to save your work.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top