How to select one record from Datasheet view & open in a form for editing?

AccessNubie

New member
Local time
Today, 02:34
Joined
Aug 10, 2012
Messages
4
My program has dynamically created a SELECT statement to pick a subset of records in a table and displayed them in Datasheet view. I want to select one of those records and open in a form for editing. How to do it?
 
I'm not sure why you can't edit the record in datasheet view but if you want to you can switch between views by selecting View on the menu and then selecting the view to be used.
 
I can certainly edit record in datasheet view, but one field is Memo and can contain lots of text. It would be more user friendly if i could select one record and open it in the form view to edit.
 
Well, as I said earlier "you can switch between views by selecting View on the menu and then selecting the view to be used."

Another way:
Put the following code in the Double Click event of a text box.
Code:
DoCmd.OpenForm Me.Name, acNormal, , "[B]YourID [/B]= " & Me.[B]YourID [/B]
Add a button to the form and use the following code in the On Click event
Code:
DoCmd.OpenForm Me.Name, acFormDS, , "[B]YourID [/B]= " & Me.[B]YourID [/B]
You would need to change YourID to the name of the Primary Key field in the table.
 
Well, as I said earlier "you can switch between views by selecting View on the menu and then selecting the view to be used."

Another way:
Put the following code in the Double Click event of a text box.
Code:
DoCmd.OpenForm Me.Name, acNormal, , "[B]YourID [/B]= " & Me.[B]YourID [/B]
Add a button to the form and use the following code in the On Click event
Code:
DoCmd.OpenForm Me.Name, acFormDS, , "[B]YourID [/B]= " & Me.[B]YourID [/B]
You would need to change YourID to the name of the Primary Key field in the table.

Sir
when i do this .it show no methad or data

pls clr me
 
Is your ID field defined as a Number or as Text?

Copy and post the exact code you're using, including the Sub Header.

Linq ;0)>
 
Sir
when i do this .it show no methad or data

pls clr me
Which line of code produces an error? The button’s On Click event or the Double Click event of the text box?
Can you show us your code?
 
...Which line of code produces an error? The button’s On Click event or the Double Click event of the text box...
Since the Op is starting out with a Datasheet View Form, it can't be a Command Button. I just wonder if he's put your code in the DoubleClick event in code, or in the Properties Pane, itself!

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom