I have database which as a mainform and that then has multiple subforms all identical except i need to change the record no of each so each subform then shows slightly different information to the user.
Main Form ProjectRef = "Smith"
SubForm1 filter on ProjectRef and should be on Record 1
SubForm2 filter on ProjectRef and should be on Record 2
SubForm3 filter on ProjectRef and should be on Record 3
SubForm4 filter on ProjectRef and should be on Record 4
SubForm5 filter on ProjectRef and should be on Record 5
SubForm6 filter on ProjectRef and should be on Record 6
If there are no records for "Smith" then Create one
If there is one record then subform1 shows suform 2 is replaced by a button to create new record if required
Subform 3 same as 2
456etc all as 2
I have subforms filtered apart from moving to the relevant record
Ihave tried openargs bookmark what would be the best way of doing this and if possible a starter as i quite new to VBA
The sub forms are details of windows (Glazing) and include a drawing which is displayed in the subform so the idea is to display the subform with drawing for each item within the main page to give users a visual confirmation that they have accounted for all the items required and all the window units required additionally if the user clicks on an individual subform (picture) they open an another Form (the SubForm is a cut down version of this) which takes them to the appropriate record to modify it and then returns them to the Main Form.
I'm still not convinced that what you are asking is the right path for your needs, it just seems like you are over complicated the situation. It would be easier to manage as a single form with a single subform that the user can navigate through to see all the records. But...
If you really want to dynamically create and manage 7 forms the easiest way is probably to open a recordset in your code for items that match your projectref, then loop through all the records opening and populating the required subforms as you go alone. When you get to the last record open the "add new" form instead.
Unfortunately, since you are quite new to VBA, this probably isn't the solution you want to deal with. I would change the design at this point so this solution is all I can come up with! Maybe someone else can think of a simpler way to manage 7 forms.
I totally agree that one form would be easier than managing 7 sub forms, 7 is probably the bottom end if it works there could be alot more which I think is going to be extremly difficult to manage and keep a reasonable speed, I think best Option is possibly the you one suggested single form with a single subform to navigate through.