Solved

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

Posted on 2009-04-01
4
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
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…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

729 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