I have writtena system primarily code based, however I seem to be getting stuck on what I presume to be a relatively easy area. I have a main form which is essentially a Tab Control (9 options) called ....frmTabData. Within each of these option I have subforms such as frmProperty, frmBank, frmNextofKin.
I have written a function to capture the address details relevant to each of theses subforms from a single address form, popAddress. Whichever form I open the address form from writes its name via caption to a lable on add frm.
My problem is I have written if statements to determine which form is open and hence wrie to appt table, but I cannot see the subform primary key fields. The code will recognise frmTabData but notfrmProperty (underlying subform), here is my code.
strlabel = frmcurrent("lblsource").Caption
If strlabel = "Property" Then
Set dbcurrent = CurrentDb
Set rstAddress = dbcurrent.OpenRecordset("tblAddress", dbOpenForwardOnly)
Set frmProperty = Forms("frmProperty")
Cheers for this,
I did try this but still no luck, in the end I have decided to use individual forms. This db is a fairly straightforward one but I am having one of those 'nothing works......ever' days.
Aesthetically it looks poor but this is a work thing and I dont care if the user thinks it looks ugly, it works.