Form Perameter Value

G

Guest

Hallo

I hope some one can help me. I need to code if i click on a butten it needs
to ask for a perameter like a month where i can enter a value and then set
that value to a hiden field in a form. If some one can help me with the code
for that.

Thank you
Markus
 
T

Todd Shillam

Markus,

Try creating two hidden fields on your form. Change your query so it is
bound to the form's two hidden fields. Using the form's button OnClick
event, try using a couple inputboxes to set the value of both hidden fields
and to then open your query.

Todd
 
G

Guest

In the Command Button's OnClick Event procedure:

Dim strValue As Variant

varValue=InputBox(MyPrompt, MyTitle)
' Where MyPrompt and MyTitle are strings, e.g.,
' varValue = InputBox ("Enter value", "Mystery Value")

'If user presses Cancel, InputBox returns a blank string
If strValue<>"" Then
' Do additional error-checking here to verify the type of value received
' If it's to be a number, convert the returned string
' varValue = Val(varValue)
' Assign to textbox
Me![MyTextBox]=varValue
End If

Hope that helps.
Sprinks
 

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