princessdmb
Registered User.
- Local time
- Today, 14:13
- Joined
- Sep 1, 2011
- Messages
- 15
Hello,
I'm creating a database to track new policies request. I have a form in datasheet view that displays a list for all Initial Review and Draft status. I would like to click (... or maybe double click) on the Policy Name field that will display all fields into single form that is link to PolicyID ... to update any info needed. In other words i want to click on that record to be display in actual form.
Private Sub PolicyName_Click()
Dim stDoc As String
Dim stWhere As String
Dim strsql As String
Dim DB As DAO.Database
Dim qdf As DAO.QueryDef
Dim sSQL As String
Set DB = CurrentDb()
Set qdf = DB.QueryDefs("qry_detail")
strsql = "SELECT * FROM [tbl_Policy]"
strwhere = "Where ([PolicyName] = '" & Me.PolicyName & " ') and ([PolicyID] = '" & Me.PolicyID & " ')"
strsql = strsql & strwhere & ";"
qdf.SQL = strsql
DoCmd.Close
DoCmd.OpenForm "frm_PndPolicyUpdate"
End Sub

I'm creating a database to track new policies request. I have a form in datasheet view that displays a list for all Initial Review and Draft status. I would like to click (... or maybe double click) on the Policy Name field that will display all fields into single form that is link to PolicyID ... to update any info needed. In other words i want to click on that record to be display in actual form.
Private Sub PolicyName_Click()
Dim stDoc As String
Dim stWhere As String
Dim strsql As String
Dim DB As DAO.Database
Dim qdf As DAO.QueryDef
Dim sSQL As String
Set DB = CurrentDb()
Set qdf = DB.QueryDefs("qry_detail")
strsql = "SELECT * FROM [tbl_Policy]"
strwhere = "Where ([PolicyName] = '" & Me.PolicyName & " ') and ([PolicyID] = '" & Me.PolicyID & " ')"
strsql = strsql & strwhere & ";"
qdf.SQL = strsql
DoCmd.Close
DoCmd.OpenForm "frm_PndPolicyUpdate"
End Sub