alastair69
Registered User.
- Local time
- Today, 06:21
- Joined
- Dec 21, 2004
- Messages
- 562
Hello All,
I have a form that runs this section of code to generate a list of companies to call this works fine :
strSQL = "Update [JT Client List] set TempAccountManager = " & intAccountManager
strSQL = strSQL & ", TempAccountDate = #" & Format(CStr(datToday), "dd mmm yyyy") & "# "
strSQL = strSQL & " where ClientID in ( "
strSQL = strSQL & " SELECT TOP 50 [JT Client List].ClientID "
strSQL = strSQL & " FROM [JT Client List]"
strSQL = strSQL & " where (isnull([JT Client List].[TempAccountManager]) or [JT Client List].[TempAccountManager] = 0) "
strSQL = strSQL & " and (isnull([JT Client List].[AccountManager]) or [JT Client List].[AccountManager] = 0) "
strSQL = strSQL & " ORDER BY RandomNumber([ClientID]));"
dbs.Execute strSQL
What i need to do now is to setup away of setting a defualt number of records for example i need only 10 records, i now that if you alter the select 50 line to 10 this works but i need a way of doing this with out going into the cade each time.
The ideal solution would be a form that asks the user to input the value if one does not alread exist
Any body any ideas......
Alastair
I have a form that runs this section of code to generate a list of companies to call this works fine :
strSQL = "Update [JT Client List] set TempAccountManager = " & intAccountManager
strSQL = strSQL & ", TempAccountDate = #" & Format(CStr(datToday), "dd mmm yyyy") & "# "
strSQL = strSQL & " where ClientID in ( "
strSQL = strSQL & " SELECT TOP 50 [JT Client List].ClientID "
strSQL = strSQL & " FROM [JT Client List]"
strSQL = strSQL & " where (isnull([JT Client List].[TempAccountManager]) or [JT Client List].[TempAccountManager] = 0) "
strSQL = strSQL & " and (isnull([JT Client List].[AccountManager]) or [JT Client List].[AccountManager] = 0) "
strSQL = strSQL & " ORDER BY RandomNumber([ClientID]));"
dbs.Execute strSQL
What i need to do now is to setup away of setting a defualt number of records for example i need only 10 records, i now that if you alter the select 50 line to 10 this works but i need a way of doing this with out going into the cade each time.
The ideal solution would be a form that asks the user to input the value if one does not alread exist
Any body any ideas......
Alastair
Last edited: