RE: Help needed with form (little or no experience)

Tech-Archive recommends: Speed Up your PC by fixing your registry



This is a common problem and question. The first step is to do a Dlookup to
see what the current number is:

DLookup('Process ITMS
'Get a List of ITMS
strsql = "SELECT CISAttributeTable.ITM " _
& "FROM CISAttributeTable_ME " _
& "GROUP BY ITM;"
Set rstItms = qdf.OpenRecordset(strsql, dbOpenSnapshot, dbReadOnly)
If rstItms.RecordCount > 0 Then
rstItms.MoveLast
rstItms.MoveFirst
lngItmCount = rstItms.RecordCount
If Me.opgRecurring = 1 Then
Call Build_RR_Report
Else
Call Build_NR_Report
End If
End If
rstItms.Close

'Process Program Managers
'Get a List of Program Managers
strsql = "SELECT CISAttributeTable.[Program Manager] " _
& "FROM CISAttributeTable_ME " _
& "GROUP BY [Program Manager];"
Set rstItms = qdf.OpenRecordset(strsql, dbOpenSnapshot, dbReadOnly)
If rstItms.RecordCount > 0 Then
rstItms.MoveLast
rstItms.MoveFirst
lngItmCount = rstItms.RecordCount
If Me.opgRecurring = 1 Then
Call Build_RR_Report
Else
Call Build_NR_Report
End If
End If


"colm o'brien" wrote:

> Hi
>
> I have a table called clients these are clients of an insurance brokerage,
> the brokerage has no control over the format of the reference applied to each
> client. these take the form of the first two letters of surname followed by
> first two letters of forename followed by 2 digits.
>
> the first time any combination is used the digits would be 01 the next 02
> and so on.
>
> so john doe would be dojo01, joanne doe would be dojo02 etc.
>
> these are stored in table clients with fields F_name, S_name, C_ref.
>
> i want a form which when data is entered will check all the existing records
> to see if combination exists and create c_ref automatically
>
> thanks
>
>
.