Hi Ed,
I am not sure if I totally understand your meaning. Did you mean that you
just wanted to find a query to produce unique VendorID in the query
result?
I saw that you wanted to use a letter A, B,..., etc to append to VendorID
value, however what is the postfix letter if one VendorID has more than 26
files matched?
Regarding your requirement, I think that using number as postfix instead
of
letter would be better. You can write a function to do this. For example:
Public Function VendorUniqueID(currentVendorID As Integer) As String
Static t_vendorId As Integer
Static t_nCount As Long
Dim strUniqueId As String
If IsEmpty(t_nCount) Or IsEmpty(t_vendorId) Then
t_vendorId = 0
t_nCount = 0
End If
If t_vendorId <> 0 And t_vendorId = currentVendorID Then
t_nCount = t_nCount + 1
Else
t_vendorId = currentVendorID
t_nCount = 1
End If
strUniqueId = CStr(t_vendorId) & "." & CStr(t_nCount)
VendorUniqueID = strUniqueId
End Function
Then you can save the following query as "qryVendorFile":
SELECT VendorUniqueID(VendorID) AS NewVendorID, FileName FROM VendorFile;
Then you can query the records as following:
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set db = CurrentDb
Set qdf = db.QueryDefs("qryVendorFile")
Hope this helps. If you have any other questions or concerns, please feel
free to let me know.
Best regards,
Charles Wang
Microsoft Online Community Support
===========================================================
Delighting our customers is our #1 priority. We welcome your
comments and suggestions about how we can improve the
support we provide to you. Please feel free to let my manager
know what you think of the level of service provided. You can
send feedback directly to my manager at: (e-mail address removed).
===========================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for
non-urgent issues where an initial response from the community
or a Microsoft Support Engineer within 1 business day is acceptable.
Please note that each follow up response may take approximately
2 business days as the support professional working with you may
need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by
contacting Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
============================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.
=========================================================