# Access: Form with subform datasheet. Selecting record on datasheet shows in form.



## firestormer (Sep 16, 2005)

I want to create a form in a sort inbox style so i ahve a list of records at the top in a datasheet and then by clicking on the list the details should show up in colunmar view below.

Sound simple its not.

I can get it to work the other way round by having a datasheet subform in my main form but thats not much use.

What i need to do is to somehow reverse how the form subform relationship works.

Any ideas?


----------



## OBP (Mar 8, 2005)

The problem is that with a datasheet view Access doesn't know which record you are in, if you change it to a "Continuous form" with record selectors as "yes" it will know which record is chosen.
Can you post a zipped copy of the database on here?


----------



## firestormer (Sep 16, 2005)

Ok here we are. see attatched

The offending forms are

FrmFaultReportInbox
FrmFaultReportInbox subform

with table

TblFaultReport

Is a bit messy and you can ignore all the other tables for this.

What im trying to create is a fault report system to allow people to report faults with computers and devices over a LAN


----------



## firestormer (Sep 16, 2005)

Ive been looking at a way of having the souce for the main form as query which takes results out the subformbut ive havnt had much success yet


----------



## OBP (Mar 8, 2005)

firestormer, what are you trying to do with the subform?
Are you trying to select a record and have the main form go to it?


----------



## OBP (Mar 8, 2005)

Something like this?


----------



## firestormer (Sep 16, 2005)

I want it so that the records are liste in the subform and by secting a record in the subform it will show up in the main form.


----------



## firestormer (Sep 16, 2005)

Thats an intresting way of doing it ill go back t othat if all fails.
Is it possible to have that but with the list always expanded?


----------



## OBP (Mar 8, 2005)

You can use a List box instead of a combo box to do the same kind of thing, now that I know what it is that you want to do I will see if I can make your original version do what you want.
You are in actual fact doing it back to front, you normally select a record on the Main form and have the Sub form show the Data.


----------



## OBP (Mar 8, 2005)

Sorry, I can't get it to do it from the subform because the Main Form loads up first.
But I have changed the Combo Box to a List Box and it now looks more like your original.
Try this one.


----------



## firestormer (Sep 16, 2005)

Wow wer relly on the same wavelength. i just changed it to a list box before looking at ur last 2 posts and it works perfectly!

I copied ur VB code and altered it a bit. im slowly learning more VB.
Now all i need to do is set it to update the listbox when changes are made which should be easy (fingers crossed)

Thanks loads


----------

