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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to get the value for another form? 1

Status
Not open for further replies.

childrenfirst

Technical User
Oct 15, 2006
80
0
0
US
Hi,

I have two forms in the Access Project file. When I click on the command button on the frmMain, a value should be loaded into the other form, frmList. However, my code does not seem to retrieve and load the value into frmList properly. Any advice will be greatly appreciated!

Here is what I have tried so far:

Dim strReportNum AS String

strReportNum = "SELECT MAX(ListNum) FROM List"
DoCmd.OpenForm "frmList"
Form![frmList]![txtListNum] = strReportNum

I also tried:

DoCmd.OpenForm "frmList"
Form![frmList]![txtListNum] = "SELECT MAX(ListNum) FROM List"


None of them worked so far...

Happy holiday!
 
you can open it with a simple macro using 2 lines the OpenForm and SetValue

hope this would be easier for you

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
What about Forms![frmList]![txtListNum] =

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
And what about this ?
DoCmd.OpenForm "frmList"
Forms![frmList]![txtListNum] = DMax("ListNum", "List")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
phv sound correct how can i forget that

happy holidays

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
Hi all,

Thank you for all your help! DMaxt worked out perfectly!
Thank you, PHV, and of course, other ideas!

Happy holiday:D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top