Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2009-04-01
4
Medium Priority
?
454 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 2000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

926 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