3 questions

O

OverMyHead

First, I would like to thank everyone here that has helped me (and others).
I’m sure you don’t get paid to answer these questions, so I thank you for all
your time.

I have 3 questions that I am hoping you can help me with.

1. How do I change the default location of the curser when I open my form?
For Example: When I open my form it defaults to the textbox
“txtSecondAttempt†and I want it to default to “txtFirstAttemptâ€.

2. The form I have is used when we try to contact a customer to verify their
issue is resolved. Because of this it is important to have both the date and
time visible in the field, but I have only been successful in having it
populate the date (a calendar appears to the right and the user selects the
date). How do I get it to show the date AND time?

3. This form uses a combo box which links the information on the form to all
the data in the table. When I open the form it displays the information to a
random (or so it seems, I'm sure there is some logic to the record it opens
to) record in the table. How do I make it so that the form is blank until I
select a record from the dropdown at the top of the form?

Again, thank you all for any help you can provide.

Scott
 
O

OverMyHead

Okay, now I feel ignorant...I figured out WHY the curser starts out where it
does (which is the Tab Index on the "Other Tab".

Any answers for the other 2 questions? Ill keep working on them...
 
N

niuginikiwi

Some hints for your first 2 questions. See below.


OverMyHead said:
First, I would like to thank everyone here that has helped me (and others).
I’m sure you don’t get paid to answer these questions, so I thank you for all
your time.

I have 3 questions that I am hoping you can help me with.

1. How do I change the default location of the curser when I open my form?
For Example: When I open my form it defaults to the textbox
“txtSecondAttempt†and I want it to default to “txtFirstAttemptâ€.

Open the propery sheet of txtFirstAttempt and on the Other tab, change Tab
Index to 0

2. The form I have is used when we try to contact a customer to verify their
issue is resolved. Because of this it is important to have both the date and
time visible in the field, but I have only been successful in having it
populate the date (a calendar appears to the right and the user selects the
date). How do I get it to show the date AND time?

Go to the property sheet of the txtDateField ( you may have a different name
to this) and on the Format tab change Format to General Date.
 
O

OverMyHead

Thank you niuginikiwi for the answer.

I tried your suggestion for #2, but it did not change. It still displays
just the date and not the time.
 
J

John W. Vinson

First, I would like to thank everyone here that has helped me (and others).
I’m sure you don’t get paid to answer these questions, so I thank you for all
your time.

I have 3 questions that I am hoping you can help me with.

1. How do I change the default location of the curser when I open my form?
For Example: When I open my form it defaults to the textbox
“txtSecondAttempt” and I want it to default to “txtFirstAttempt”.

Set the Tab Index property of txtFirstAttempt to 0.

If that doesn't work as you wish, use the following code in the form's Current
event:

Private Sub Form_Current()
Me!txtFirstAttempt.SetFocus
End Sub
2. The form I have is used when we try to contact a customer to verify their
issue is resolved. Because of this it is important to have both the date and
time visible in the field, but I have only been successful in having it
populate the date (a calendar appears to the right and the user selects the
date). How do I get it to show the date AND time?

A Calendar Control sets just the date. What time do you want selected? If you
JUST want the current date and time in the field, don't use a calendar control
at all; instead use a command button or the textbox's DoubleClick event to set
the textbox to Now:

Private Sub txtResolvedAt_DoubleClick()
Me!txtResolvedAt = Now
End Sub
3. This form uses a combo box which links the information on the form to all
the data in the table. When I open the form it displays the information to a
random (or so it seems, I'm sure there is some logic to the record it opens
to) record in the table. How do I make it so that the form is blank until I
select a record from the dropdown at the top of the form?

What's the code in your combo box's AfterUpdate event?

What you could do is give the form a Filter property which returns no records
(e.g. Me.Filter = "1 = 0"), and change the filter property in the combo's
afterupdate event.
 
O

OverMyHead

Thank you John for your help!

Q's 1 and 3 are resolved (I just eliminated the cbx in #3 when I realized
that it wasen't necessary).

However, I am still having problems with #2. I tried both changing code for
"On Dbl Click" to the suggested...

Private Sub txtFirstDT_DblClick()
Me!txtFirstDT = Now()
End Sub

However, when I double click the field I get an error saying:

"The expression on Dbl Click y ou entered as the event property setting
produced the following error: Procedure declaration does not match
description of event or procedure having the same name.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error ecaluating the function, event, or marco."

I have been trying to resolve it, but cant seem to get it to work.
 
J

John W. Vinson

Thank you John for your help!

Q's 1 and 3 are resolved (I just eliminated the cbx in #3 when I realized
that it wasen't necessary).

However, I am still having problems with #2. I tried both changing code for
"On Dbl Click" to the suggested...

Private Sub txtFirstDT_DblClick()
Me!txtFirstDT = Now()
End Sub

However, when I double click the field I get an error saying:

"The expression on Dbl Click y ou entered as the event property setting
produced the following error: Procedure declaration does not match
description of event or procedure having the same name.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error ecaluating the function, event, or marco."

Sorry, my mistake: should be

Private Sub txtFirstDt_DblClick(Cancel as Integer)

Try selecting the textbox in form design view; on the Events tab find the dbl
click event; click the ... icon by it, and select Code Builder. Access will
put you into the VBA editor with the Sub and End Sub lines already filled in.
 
O

OverMyHead

Perfect!!!

Thank you so much for all your help!

John W. Vinson said:
Thank you John for your help!

Q's 1 and 3 are resolved (I just eliminated the cbx in #3 when I realized
that it wasen't necessary).

However, I am still having problems with #2. I tried both changing code for
"On Dbl Click" to the suggested...

Private Sub txtFirstDT_DblClick()
Me!txtFirstDT = Now()
End Sub

However, when I double click the field I get an error saying:

"The expression on Dbl Click y ou entered as the event property setting
produced the following error: Procedure declaration does not match
description of event or procedure having the same name.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error ecaluating the function, event, or marco."

Sorry, my mistake: should be

Private Sub txtFirstDt_DblClick(Cancel as Integer)

Try selecting the textbox in form design view; on the Events tab find the dbl
click event; click the ... icon by it, and select Code Builder. Access will
put you into the VBA editor with the Sub and End Sub lines already filled in.
 
O

orazio antonio filieri

NBNMSABMNBnmbs,mn


Il 21/08/09 22:06, in (e-mail address removed),
OverMyHead said:
Perfect!!!

Thank you so much for all your help!

John W. Vinson said:
Thank you John for your help!

Q's 1 and 3 are resolved (I just eliminated the cbx in #3 when I realized
that it wasen't necessary).

However, I am still having problems with #2. I tried both changing code for
"On Dbl Click" to the suggested...

Private Sub txtFirstDT_DblClick()
Me!txtFirstDT = Now()
End Sub

However, when I double click the field I get an error saying:

"The expression on Dbl Click y ou entered as the event property setting
produced the following error: Procedure declaration does not match
description of event or procedure having the same name.

*The expression may not result in the name of a macro, the name of a
user-defined function, or [Event Procedure].
*There may have been an error ecaluating the function, event, or marco."

Sorry, my mistake: should be

Private Sub txtFirstDt_DblClick(Cancel as Integer)

Try selecting the textbox in form design view; on the Events tab find the dbl
click event; click the ... icon by it, and select Code Builder. Access will
put you into the VBA editor with the Sub and End Sub lines already filled in.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top