Solved

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

Posted on 2009-04-01
4
406 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now