Get value from a field on a sub-form

G

Guest

Hi,

I have a subform (frm_Subform1) which is on a form (Frm_Form1). The
sub_form has one field only on it - 'Food_Time'.

I want the user to be able to scroll down the list, click on the desired
food time (only ever selecting one at a time) then click on a button. The
code should be able to return the value of the food time.

I want a message box to show 'Food Time is " & Selected_Food_Time.

I also then want to do into another table and using the 'Selected_Food_Time'
delete that record from a table called 'Tbl_Food_Times_Available'.

Thanks in advance
 
G

Guest

To refer to a field in the subform from the main form you need

Me.[SubFormControlName].Form![FieldName]

So try
MsgBox "Footd time is " & Me.[frm_Subform1].Form![Food_Time]
===================================
The "Me" apply to the current form, where the button located on
===================================

I'm not sure about the second question, what do you want to delete, and what
do you want to insert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top