I am trying to make a form that mimics the action of a subform; i.e., when the user launches it (via a command button with the caption 'Programme...') , theoretically the new form is passed the value of the record that was being viewed, and then any linked data can be viewed and new records added. But it doesn't work.
This doesn't seem to be a very common thing to do. However, I am not sure how else to proceed, as I've run out of room on my main form!
I'll try to explain better:
The project is a detailed multi-level listing of various details about buildings. My main form, frm3ViewEditAdd Properties, contains a general information section and a series of tabs; generally these have been working fine with correctly linked subforms etc. One of my tabs is devoted to a subform called frm4subfrmRooms (linked by parent/child fields PropIndex), which shows the various rooms contained in the building in single-form view with navigation buttons. It already has a sub-subform called frm5subsubRoomF unctions (linked by parent/child fields RoomIndex), which shows the suitable functions the room might be used for in continous-form view. The other thing I need to add is a programme of events that take place throughout the week within that room.
This is where I've run into trouble... I tried to launch a new form, frm6RoomProgram me, that would display the property name and room name already selected in the main form and its subform, followed by a continuous-view subform with details of all of the events in that room. I've called this subform frm7subfrmProgr ammeListing and linked master field txtProgrammeRoo mIndex (a textbox generated by a DLookUp of rooms matching textbox txtRoomIndex that is already displaying on the main form's subform) to child field RoomIndex.
The approach above means I can read data that is already there, but I can't figure out how to get it to accept new data, presumably because it is linking based on a DLookUp instead of a bound control. Unless I have inserted something at the table level, nothing at all shows in the subform, no matter what permissions the user has. This second form is bound to qry_tblRooms, so I tried adding a textbox (txtRoomIndex) that reflects the primary key directly (RoomIndex), but now I am seeing the "(AutoNumbe r)" text there, so I realised it is not bound to anything at all.
I tried adapting Microsoft's code that establishes a 'last viewed' setting for the user (stored in a special table), but I'm not very familiar with recordsets yet, so I don't know if that sort of approach translates at all.
Can anyone help?
This doesn't seem to be a very common thing to do. However, I am not sure how else to proceed, as I've run out of room on my main form!
I'll try to explain better:
The project is a detailed multi-level listing of various details about buildings. My main form, frm3ViewEditAdd Properties, contains a general information section and a series of tabs; generally these have been working fine with correctly linked subforms etc. One of my tabs is devoted to a subform called frm4subfrmRooms (linked by parent/child fields PropIndex), which shows the various rooms contained in the building in single-form view with navigation buttons. It already has a sub-subform called frm5subsubRoomF unctions (linked by parent/child fields RoomIndex), which shows the suitable functions the room might be used for in continous-form view. The other thing I need to add is a programme of events that take place throughout the week within that room.
This is where I've run into trouble... I tried to launch a new form, frm6RoomProgram me, that would display the property name and room name already selected in the main form and its subform, followed by a continuous-view subform with details of all of the events in that room. I've called this subform frm7subfrmProgr ammeListing and linked master field txtProgrammeRoo mIndex (a textbox generated by a DLookUp of rooms matching textbox txtRoomIndex that is already displaying on the main form's subform) to child field RoomIndex.
The approach above means I can read data that is already there, but I can't figure out how to get it to accept new data, presumably because it is linking based on a DLookUp instead of a bound control. Unless I have inserted something at the table level, nothing at all shows in the subform, no matter what permissions the user has. This second form is bound to qry_tblRooms, so I tried adding a textbox (txtRoomIndex) that reflects the primary key directly (RoomIndex), but now I am seeing the "(AutoNumbe r)" text there, so I realised it is not bound to anything at all.
I tried adapting Microsoft's code that establishes a 'last viewed' setting for the user (stored in a special table), but I'm not very familiar with recordsets yet, so I don't know if that sort of approach translates at all.
Can anyone help?
Comment