M
mhmaid
have just started using access 2007 , therefore I am facing many problems
i have a button on my main form when clicked it will open a search
form,there when i double click a record it will take me to the same record in
main form (filter)
after that i may need to search for another record , so i will click the
button , open the search form and from there it will open the main form
filtered on the record selected in the search form
this was going ok in access 2003
but in access 2007 , it will take me to the record that was selected in the
first time ,i.e.first time filtered
how can i solve this problem
i wanted to put the code behind the search form but unfortunately I am at
home now and dont have db with me , it at office
but its just an amenede copy of this code
Private Sub ReviewProducts_Click()
' This code created in part by Command Button Wizard.
On Error GoTo Err_ReviewProducts_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String
' If CompanyName control is blank, display a message.
If IsNull(Me![CompanyName]) Then
strMsg = "Move to the supplier record whose products you want to
see, then press the Review Products button again."
intStyle = vbOKOnly
strTitle = "Select a Supplier"
MsgBox strMsg, intStyle, strTitle
Me![CompanyName].SetFocus
Else
' Otherwise, open Product List form, showing products for current
supplier.
strDocName = "Product List"
strLinkCriteria = "[SupplierID] = Forms![Suppliers]![SupplierID]"
DoCmd.OpenForm strDocName, , , strLinkCriteria
DoCmd.MoveSize (1440 * 0.78), (1440 * 1.8)
End If
Exit_ReviewProducts_Click:
Exit Sub
Err_ReviewProducts_Click:
MsgBox Err.Description
Resume Exit_ReviewProducts_Click
End Sub
let is say my main form is product list
and first i seach for record number 49
then i wanted to see record number 584
form will open but will show me record number 49
this is only with access 2007
before every thing was going fine
i have a button on my main form when clicked it will open a search
form,there when i double click a record it will take me to the same record in
main form (filter)
after that i may need to search for another record , so i will click the
button , open the search form and from there it will open the main form
filtered on the record selected in the search form
this was going ok in access 2003
but in access 2007 , it will take me to the record that was selected in the
first time ,i.e.first time filtered
how can i solve this problem
i wanted to put the code behind the search form but unfortunately I am at
home now and dont have db with me , it at office
but its just an amenede copy of this code
Private Sub ReviewProducts_Click()
' This code created in part by Command Button Wizard.
On Error GoTo Err_ReviewProducts_Click
Dim strMsg As String, strTitle As String
Dim intStyle As Integer
Dim strDocName As String, strLinkCriteria As String
' If CompanyName control is blank, display a message.
If IsNull(Me![CompanyName]) Then
strMsg = "Move to the supplier record whose products you want to
see, then press the Review Products button again."
intStyle = vbOKOnly
strTitle = "Select a Supplier"
MsgBox strMsg, intStyle, strTitle
Me![CompanyName].SetFocus
Else
' Otherwise, open Product List form, showing products for current
supplier.
strDocName = "Product List"
strLinkCriteria = "[SupplierID] = Forms![Suppliers]![SupplierID]"
DoCmd.OpenForm strDocName, , , strLinkCriteria
DoCmd.MoveSize (1440 * 0.78), (1440 * 1.8)
End If
Exit_ReviewProducts_Click:
Exit Sub
Err_ReviewProducts_Click:
MsgBox Err.Description
Resume Exit_ReviewProducts_Click
End Sub
let is say my main form is product list
and first i seach for record number 49
then i wanted to see record number 584
form will open but will show me record number 49
this is only with access 2007
before every thing was going fine