Solved

datasheet subform column order changed, now vba problems????????

Posted on 2009-04-01
4
422 Views
Last Modified: 2013-11-28
i have a sub form that i use as a list to pick from to fill the fields in the main form.  i had it working using this.......
Private Sub cardItem_GotFocus()
Me.Parent.cardID = Me.cardID
Me.Parent.cardItem = Me.cardItem
End Sub
i needed to change the order of the columns in the subform datasheet view and had lots of trouble.  i finely just cut the fields i wanted to move to the end of the datasheet and then just re-pasted them.  that worked to get the order of columns correct but now the above code doesnt want to work anymore.  i have no clue how to fix this problem.
any ideas?
0
Comment
Question by:sumhungl0
  • 2
  • 2
4 Comments
 
LVL 28

Expert Comment

by:TextReport
ID: 24038167
Do you get any error messages?
Ensure the Control Names haven't changed.
Ensure the Even Procedures are still set.
Put a break point (F9) on the first line of code and test it to see if it is running.

Cheers, Andrew
0
 

Author Comment

by:sumhungl0
ID: 24038624
error is "cant assign a value to this object"  i hit debug and it brings me to this line..
Me.Parent.cardID = Me.cardID

all the names are fine

how do i ensure event procedures are still set?

and the code is running
0
 
LVL 28

Accepted Solution

by:
TextReport earned 500 total points
ID: 24038670
"how do i ensure event procedures are still set?" you can see this in the properties sheet.

With regards to the error then please check that Me.Parent.cardID has either a field as the control source or no control source.

Cheers, Andrew
0
 

Author Comment

by:sumhungl0
ID: 24039005
got it.  it was giving me the error because the subform first tab stop was the field that the code was running.  the forms loaded slower then the gotFocus ran.  so i took all the tab stops out and it doesnt error.  so problem fixed.  i also remade the subform so i could set the order of columns in datasheet view.  so thanks anyway.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question