Multi Form based on one table

Brahim

New member
Local time
Today, 18:10
Joined
Jun 21, 2003
Messages
8
Hi,

I have a big Questionnaire in multi pages, i want to give the user the same interface like on the paper for that i created multiples Forms (frmPage1, frmPage2, ...frmPage17) when the user click on the next button to go to the second form (frmPage2) i want to continue to enter in the same row (same PK) of the row created in Page1

here my code

Private Sub cmdNext_Click()
On Error Resume Next


Dim PageName As String
Dim LinkCriteria As String

PageName = "frmPage2"

' the field that contains PK on frmPage1


LinkCriteria = "[LICENSE_CODE] = Forms![frmPage1]![cboLicenceType]"
LinkCriteria = LinkCriteria & " And [EST_LICENSE_NO] = Forms![frmPage1]![txtLicenceNo]"

' opening the second page

DoCmd.OpenForm PageName, , , LinkCriteria

'Close the first one
DoCmd.Close A_FORM, "frmPage1"
'End If
'--------------------------------------------------------------------------------

End Sub

Thanks a lot
 
I'm not sure what your question is, but if you're looking for suggestions, it might be easier to use a single form with page breaks or to create a form with the tab control on it. Either way will simulate having separate forms for each page and will keep everything together on one form so you don't have to bother with switching form. You will just need to move between pages/tabs of the same form.
 
The problem is i have 17 form and some have the same table by example frmPage1 and 2 and 3 have the same source : tblIdentInfo frmpage14, 15, 16 also the same source tblxxxx but all those form have the same fields to link them each other..

i think that the solution need to be on different forms
 

Users who are viewing this thread

Back
Top Bottom