im totally new to access, my 8 month project at work is to create a access
db. anyway i want the first form to close and open a new form when next is
clicked. i did that. but i also want the new form to open with the same ID
field as the first form. this is what i have now and it doesn't work:
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "ID=" & Me.ID
DoCmd.Close
stDocName = "Water: Sweet Grass"
DoCmd.OpenForm stDocName, , , stLinkCriteria
reservedbcreater - 25 Jan 2005 16:36 GMT
there are 17 forms all following each other(its a survey), each form has an
ID field. all forms open as soon as next is clicked. everytime its clicked
i want the next form to open with ID field the same as previous......so
that once u fill out all 17 forms, they all have the same ID field.
Also if possible, i want the first form to open at the first unused ID
#???????????
anonymous@discussions.microsoft.com - 25 Jan 2005 16:53 GMT
hi,
not sure but you may have a sequence problem.
open the 2nd form before closing the 1st form.
try somthing like this
Private Sub cmdgo_Click()
Dim stLinkCriteria As String
stLinkCriteria = Me![CustID]
DoCmd.OpenForm "frmtest2", acNormal, , , acFormEdit
[Forms]![2ndform]![txtbox1] = stLinkCriteria
DoCmd.Close acForm, Me.Name, acSaveYes '1stform
End Sub
tested. works. (as least on tuesdays)
>-----Original Message-----
>im totally new to access, my 8 month project at work is to create a access
[quoted text clipped - 14 lines]
>
>.
Steve Conway - 25 Jan 2005 17:06 GMT
> im totally new to access, my 8 month project at work is to create a access
> db. anyway i want the first form to close and open a new form when next is
[quoted text clipped - 10 lines]
> stDocName = "Water: Sweet Grass"
> DoCmd.OpenForm stDocName, , , stLinkCriteria
Something like this in your next button's click event
Dim strDocName As String
Dim strID As String
strDocName = "Water: Sweet Grass"
strID = Me.ID
DoCmd.Close
DoCmd.Openform strDocName
Forms(strDocName)!IDFieldName = strID
HTH
Steve C
reservedbcreater - 25 Jan 2005 17:23 GMT
thank u steve C that worked perfect