Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open form with button click

Status
Not open for further replies.

MarkWright

Programmer
Jan 7, 2003
66
DE
Hello, I am trying to enter a number from one formular into another formular. I have a main formular and am opening another formular with the --> DoCmd.OpenForm "frmPBS_TestzyclusSLIN", , , "[testnr] = " & testnr & "", , acDialog
When the new formular opens one field should have the same number as the first field. I know how this works in mdb but it is not working in the adp. I can open a blank formular and enter the number from the first form and then reopen it with no problem using the code, but I want the number to be added to the new form when it'S opened. I have also used this code --> stDocName = "frmPBS_TestzyclusSLIN"

stLinkCriteria = "[testnr]=" & Me![testnr]
DoCmd.OpenForm stDocName, , , stLinkCriteria
but it is not working as well. can anyone help me ?
Thanks, have a nice day
Mark
 
The code should work OK in an ADP. I have some very similar code that doesn't give me any problems. Make sure that the datasource for frmPBS_TestzyclusSLIN includes the column [testnr] for the database to be able to filter on it and that you have a value in Me![testnr] or it will be filtering on NULL.

Clive
 
Thanks, I'll try that and see what happens.
Have a nice day
Mark
 
Make sure the FORM you are opening has filter set on.

Private Sub Form_Open(Cancel As Integer)
Me.AllowFilters = True
Me.FilterOn = True
Debug.Print "Server Filter in onopen = "; Me.ServerFilter
 
Thanks cmmrfrds, I had something wrong and the server added a filter setting. It was wrong and took me a while to find the problem, but I think I have it working now-- I hope.
Have a nice week
mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top