Senin, 19 Januari 2015

Re: [MS_AccessPros] Not in list issue

 

with all due respect, temporary records in tables bloats the database and is not a good idea.  If all you need is a query, I would suggest using a query ~

Warm Regards,
Crystal


 *
   (: have an awesome day :)
 *


On Monday, January 19, 2015 11:23 AM, "Stuart Schulman stoughy@yahoo.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:




Might I suggest the following, which should be workable:

Put the list values into a table if they're not there already, call it MyTable and the numeric field in question myField.
Have your combo box rowsource be 1 column, "Select myField from myTable".
Insert the following code in the NotInList event for myCombo:

Dim rs As Recordset
Dim sql As String
sql = "Select * from myTable Where myField = " & Val(NewData)
Set rs = CurrentDb.OpenRecordset(sql)
If Not rs.EOF Then
    myCombo = CStr(rs!myField)
    Response = acDataErrContinue
    DoCmd.GoToControl <the next control on your form>
End If
rs.close
set rs = nothing

----------------------------------------------



On Monday, January 19, 2015 12:05 PM, "Crystal strive4peace2008@yahoo.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:


 
or maybe you just want:

field --> Format(myNumber,"#.##")


Warm Regards,
Crystal


 *
   (: have an awesome day :)
 *



On Monday, January 19, 2015 10:03 AM, Crystal <strive4peace2008@yahoo.com> wrote:


Hi Adam,

use:

field --> Format(myNumber,"#,###.##")

on the grid

Warm Regards,
Crystal

Code Documenter for Access, Excel, Word, & PowerPoint
www.AccessMVP.com/strive4peace/CodeDocumenter.htm

 *
   (: have an awesome day :)
 *


On Monday, January 19, 2015 8:28 AM, "runuphillracing@yahoo.com [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com> wrote:




John,

Damned if I do? :)

It looks like the same thing happens if I don't format it as fixed vs. currency; the latter requires a "$" to find a match.

Thanks












__._,_.___

Posted by: Crystal <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

.

__,_._,___

Tidak ada komentar:

Posting Komentar