Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.RunCommand acCmdRecordsGoToNew

Status
Not open for further replies.

Kalyan Ganesan

Programmer
May 10, 2017
93
US
I have a form in which all the controls are bound by the Recordsource of the form, when the form loads it bring sup all the 100 records from the two tables that are used to link the queries as the recordsource, all the controls are being non editable, so i gave the following but it doesnt do anything at all

Dim ctrl As Control

For Each ctrl In Me.Controls

ctrl.Locked = False

Next

Me.DataEntry = True
DoCmd.RunCommand acCmdRecordsGoToNew

also tried
DoCmd.GoToRecord , , acNewRec
 
Open your query directly and see if you can make edits. If not, the query is your problem. In order to edit records in a query I think the join has to a unique index on one of the two tables. Don't remember all the rules but I think this is going to be your problem.

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That DonÆt.

 
Thanks Blorf, that makes a lot of sense,the table I created for this is a Linked Table that is linked to oracle database, and I just used another table to mimic this table,i did like Create table B as select * from A, so I am not sure if it brought all the constraints and everything along
 
That would do it. Make table queries do not bring along any indexes or constraints.

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That DonÆt.

 
I forgot to run the scripts that created the indexes(of course had to change the name of the indexes and triggers) and triggers, I ran them and now the form works fine, however some of the controls have values like #Name? instead of a blank, why is that?these are text boxes by the way
 
Most common cause for #Name is a form field is bound to a field name that doesn't exist. Second, if the field is calculated and calls on a field not there, or calls on it's self, those will do it also.

There Are 10 Types Of People In The world:
Those That Understand BINARY And Those That DonÆt.

 
Thanks again,fixed it too, was funny, there was a check box and the table name given for the bound field was incorrect, until I change it, it was also locked in blue color..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top