Open a record in form based from a datasheet double click

You may need to save it in an older format because most of us don't have Access 2010.

By the way, what happens when you open the form on it's own, without any criteria?
Do you have the Data Entry property set to Yes?
Do you have any other criteria in the record source of the form that you're opening?
Do you have any Filter set?
 
Could you just put a copy of your DB? removing all sensitive information??

Ok - see attached a new mini database (and in 2003 version) which replicates the same problems I'm having!

Hopefully this helps?

Thanks everyone for your help and patience!
 

Attachments

Last edited:
Still stuck on this - no progress over the weekend - any ideas anyone?

Thanks so much for your help
 

John I have attached some photos of the issue I have. With the WHERE-condition my form is showing as filtered.jpg whereas when I have no WHERE-condition the form is appearing as unfiltered.jpg.

For both cases the form is ready for a new record but for filtered all old posts are filtered to match the WHERE-condition. I just do not understand why when filtered a new record is shown rather than the filtered record.

My code is:

strKomponent = Forms![frmInfoMaskiner]!UnderordnetObjekt76![KomponentID]
DoCmd.OpenForm "frmKompPLC", , , "[KomponentID]=" & strKomponent, , acDialog
 

Attachments

  • Unfiltered.jpg
    Unfiltered.jpg
    41.1 KB · Views: 112
  • Filtered.jpg
    Filtered.jpg
    44.3 KB · Views: 114
You may need to save it in an older format because most of us don't have Access 2010.

By the way, what happens when you open the form on it's own, without any criteria?
Do you have the Data Entry property set to Yes?
Do you have any other criteria in the record source of the form that you're opening?
Do you have any Filter set?

By the way, what happens when you open the form on it's own, without any criteria? It just opens in add mode with all fields blank

Do you have the Data Entry property set to Yes? Yes

Do you have any other criteria in the record source of the form that you're opening? No - just the code below;

Code:
Private Sub Form_DblClick(Cancel As Integer)
DoCmd.OpenForm "frmProjectFinanceYearDetail", , , "txtFinanceYearID =" & Me.FinanceYearID
End Sub

Do you have any Filter set? Don't think so as I want this applied only when double clicking on the line on the datasheet
 
Alright, you need to set the Data Entry property to No.
 
Alright, you need to set the Data Entry property to No.

Cannot believe it was that simple :-D

Because I wanted to enter data I assumed I'd need that as Yes??? Bizarre!!

Can I also quickly ask how I refresh/requery the subform which is based on query when I've added new years or amended data in existing years?
 
Before I tell you, can you tell us why the subform is not linked to the parent form? And where are you updating this information, on the subform or the parent form?
 
because i couldn't get my forms working correctly when they were linked... so this workaround has so far until this point worked for everything else i needed...

So when i close down this data entry form the other form is open behind

I have tried setting the focus to the parent form frmProjectFinanceYear and then every combo of code I can think of or find online to requery the sub form frmFinanceYear

But the only way i achieve the refresh is to close the form down and reopen it...
 
It would be much better to work on getting your subforms linked so that Access handles the saves and refresh for you.

Here's how you Requery the subform from the parent form:
Code:
Me.SubformControlName.Form.Requery
 

Users who are viewing this thread

Back
Top Bottom