Update Record from Continuous Form

tfaiers

Registered User.
Local time
Today, 23:11
Joined
Apr 26, 2002
Messages
54
I'm slightly confused with this question as I've got two continuous forms dealing with separate parts of a database and one works and the other doesn't, so I created a test table, continuous form and entry form which does not work either.

I've got a test table with 'Acc_code', 'name' and 'postcode' as fields.

I created a continuous form with the 3 fields in which is not editable and a form with the 3 fields also on (a bit redundant but I'm just trying to see where I'm going wrong)

On the continuous form event double-click, I've got the following code:

Code:
DoCmd.OpenForm "testform", acNormal, , "[Acc_Code] = " & Me.[Acc_Code]

The code I got from searching through the forum for double click updating of continuous form records.

It looks right and compared to coding I already have for the other part of my database which works, it's almost exactly the same apart from the field names and the form name.

When I double-click on an entry, instead of it opening the single form, I get a prompt for: 'Enter Parameter Value' for the field value (so if the acc_code='test01' then it's asking for the parameter value for test01) with an entry box underneath.

If I leave it blank, it opens up the form with no records but if I type 'test01' into the box, I get the 'test01' single form record appearing.

I'd be grateful if I could have guidance for this, I'm sure it's me going wrong somewhere.

Thanks
 
It sounds like your [Acc_Code] field is text so you need to surround it with quotes:
Code:
DoCmd.OpenForm "testform", acNormal, , "[Acc_Code] = '" & Me.[Acc_Code] & "'"
 
Thanks RuralGuy, I knew it had to be something simple, just staring at it continuously, I couldn't see it.

:D
 

Users who are viewing this thread

Back
Top Bottom