brewpedals
Registered User.
- Local time
- Today, 01:37
- Joined
- Oct 16, 2002
- Messages
- 32
Hi,
I have a form used to create a new record. I would like to make data supplied by the user in a previous session the default value. I am strugling.
Here is what I have so far:
I get a "compile error: Expected function or variable" Is there an easier method, am I making this a harder problem than it is?
Thanks for your time.
I have a form used to create a new record. I would like to make data supplied by the user in a previous session the default value. I am strugling.
Here is what I have so far:
Code:
Dim lastPercent As Variant
Dim sqlPercent As String
sqlPercent = "SELECT TOP 1 PE_ConstReport.Percent_Compl" & _
"FROM PE_ConstProjects LEFT JOIN PE_ConstReport ON PE_ConstProjects.Project_No = PE_ConstReport.Project_No" & _
"WHERE (((PE_ConstProjects.Project_No) = [Forms]![F_Const_Rpt_Main]![lst_ActProj]))" & _
"ORDER BY PE_ConstReport.Rpt_Date DESC;"
lastPercent = DoCmd.RunSQL(sqlPercent)
txtPercent_Compl.DefaultValue = lastPercent
I get a "compile error: Expected function or variable" Is there an easier method, am I making this a harder problem than it is?
Thanks for your time.