brewpedals
Registered User.
- Local time
- Today, 11:45
- Joined
- Oct 16, 2002
- Messages
- 32
Hi,
I get the subject error when I run this code.
I have a table PC_PRC_Log with two primary keys AFE_No and PCR_No.
I want the user to pick the AFE_NO, and have the code count the nuber of records with the same AFE_NO, add 1, and place the value in the forms PCR_No field then display the concatenated AFE_No and PCR_No in an unbound field.
Can you tell what I've done wrong?
I did a search on this board for DCOM and found only two threads, one was associated with ActiveX. I have an ActiveX control on this form, but I get the error even ater the ActiveX control was deleted.
Many thanks for your time.
I get the subject error when I run this code.

Code:
Private Sub AFE_No_Change()
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim sql As String
sql = "SELECT Count([PC_PCR Log].AFE_No) AS CountOfAFE_No " & _
"FROM [PC_PCR Log] " & _
"HAVING (((Count([PC_PCR Log].AFE_No))=[Me].[AFE_No].[Value]));"
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(sql)
Me!PCR_No.Value = rst!UserCount + 1
Me!unb_PCR_No.Value = Me!AFE_No.Value & " - " & Me!PCR_No.Value
End Sub
I have a table PC_PRC_Log with two primary keys AFE_No and PCR_No.
I want the user to pick the AFE_NO, and have the code count the nuber of records with the same AFE_NO, add 1, and place the value in the forms PCR_No field then display the concatenated AFE_No and PCR_No in an unbound field.
Can you tell what I've done wrong?
I did a search on this board for DCOM and found only two threads, one was associated with ActiveX. I have an ActiveX control on this form, but I get the error even ater the ActiveX control was deleted.
Many thanks for your time.