Solved

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

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

747 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

9 Experts available now in Live!

Get 1:1 Help Now