By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 2,140 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

open form and select item from list Automaticly

P: 3
i have database contain main form and sub form so when i open main form i will select item [customer-name] automatically and go the coarser to the sub form to begin
Jan 21 '17 #1

✓ answered by zmbd

Your question isn't very clear:
Are you opening the parent-form to a default record/value and want the child-form control selected

OR

Are you selecting a record in the parent-form and want to then have the corresponding record in the child-form.

If you are not selecting a record in the parent-form, then how are you selecting the value for [customer-name]

In any case, to reference the control in the child-form and setfocus to it you have something like this:
Me!Subform1.form!ControlName.setfocus

> NOTE: [Subform1] is the name of the control that actually contains the form used for the child-form, typically this will default to the same name as the form you inserted. I tend to rename the subform control to prevent any circular references.

> If you are coding from within the child-form
Me.[ControlNameHere] will refer to the control on the child-form. In fact, the "Me" shortcut will always refer to that form's objects within VBA.

Parent.[ControlNameHere] will refer to the control on the parent form provided the child and parent are properly linked in the subform-container-control's properties.

You should bookmark the following if you are going to be working with controls on subforms:
http://access.mvps.org/access/forms/frm0031.htm

and

http://allenbrowne.com/casu-04.html

Finally names, I recommend using only alphanumeric and the underscore, although Access will allow spaces and other symbols, these can create issues down the road...
Problem names and reserved words in Access

Share this Question
Share on Google+
4 Replies


zmbd
Expert Mod 5K+
P: 5,286
Your question isn't very clear:
Are you opening the parent-form to a default record/value and want the child-form control selected

OR

Are you selecting a record in the parent-form and want to then have the corresponding record in the child-form.

If you are not selecting a record in the parent-form, then how are you selecting the value for [customer-name]

In any case, to reference the control in the child-form and setfocus to it you have something like this:
Me!Subform1.form!ControlName.setfocus

> NOTE: [Subform1] is the name of the control that actually contains the form used for the child-form, typically this will default to the same name as the form you inserted. I tend to rename the subform control to prevent any circular references.

> If you are coding from within the child-form
Me.[ControlNameHere] will refer to the control on the child-form. In fact, the "Me" shortcut will always refer to that form's objects within VBA.

Parent.[ControlNameHere] will refer to the control on the parent form provided the child and parent are properly linked in the subform-container-control's properties.

You should bookmark the following if you are going to be working with controls on subforms:
http://access.mvps.org/access/forms/frm0031.htm

and

http://allenbrowne.com/casu-04.html

Finally names, I recommend using only alphanumeric and the underscore, although Access will allow spaces and other symbols, these can create issues down the road...
Problem names and reserved words in Access
Jan 21 '17 #2

P: 3
hello
after update subform1 [parcodenumber] i need select [customername] from parent form automatically such ass cash customer i don't select customername manually or by mouse becuse i need speed to done my work
i am so sorry about language i don't speak eng fluently
Jan 21 '17 #3

P: 3
[IMG]file:///C:/Users/xxxx/Desktop/Untitled.gif[/IMG]

file:///C:/Users/xxxx/Desktop/Untitled.gif
Jan 21 '17 #4

zmbd
Expert Mod 5K+
P: 5,286
Hello hazemyounis,

+ We can work around most of the native>English issues and usually we're not too strict about grammar or spelling so long as the intent of the post can be determined. :)

+ If you link the parent and child forms either by Hand or by Wizard (the following link uses the wizard) then when you select the record in the parent form all of the related child records will be filtered to the child-form. If you create a new record in the child-form it will automatically enter the foreign-key value of the parent table into the child table for the new record.
Create a form that contains a subform (a one-to-many form) (MS Link)


+ So I'm still quite unsure of your question.

I see you tried to upload an image file or two.
If you would please follow these steps:
1) click on the [Advanced] button below the post reply
2) In the new page-form that opens scroll down until you see the [Manage Attachments] button and click on that.
3) In the new dialog that opens you can upload up to five files/images at one time, click on the [Browse...] button next to each "slot",
+ you can also type in a single URL - I don't usually use this...
+ Bellow these slots is a list of allowed file types and restrictions.
4) Once all of your files are listed, to the right hand side is an [Upload] button. Once uploaded of the dialog doesn't close, or if you change your mind, there is a [Close Window] button in the upper right hand side.
>> Notice there are two different Upload buttons, they may work differently, IDK, I've never used the URL upload :)

You should be returned to the advanced editor window where you can see your attached files. You can then use the hyperlinks to insert your images inline.

Perhaps when you have the images uploaded we can more clearly understand you question.
Jan 21 '17 #5

Post your reply

Sign in to post your reply or Sign up for a free account.