Prompt for a subform text field

V

viper

I need a way to prompt the user for a piece of information that will populate a text box on a subform. I thought I could prompt a field in a query which then could fill the box. There is only one (1) field in the query with a prompt of "Enter the current princple amount". The prompt shows up and the user is able to type the info in the prompt however the results do not show up anywhere.

Dim vTemp As String 'Declaring variable here
vTemp = DLookup("Nz[Currency01]", "QryPrinAmt")
Me![Currency01] = vTemp

The subform is bound and the field (Currency01) is part of the data source.Any help would be appreciated.
 
D

Douglas J Steele

Not quite sure what you're trying to do, but might the InputBox function
meet your needs?

Incidentally, your DLookup is incorrect. The Nz function requires
parentheses, and you should wrap it around the DLookup, not put it inside:

vTemp = Nz(DLookup("[Currency01]", "QryPrinAmt"))

However, if my theory about what you're trying to do is correct, all you
should need is:

Dim vTemp As String 'Declaring variable here

vTemp = InputBox("Enter the current principle amount")
Me![Currency01] = vTemp


"viper" wrote in message

I need a way to prompt the user for a piece of information that will
populate a text box on a subform. I thought I could prompt a field in a
query which then could fill the box. There is only one (1) field in the
query with a prompt of "Enter the current princple amount". The prompt
shows up and the user is able to type the info in the prompt however the
results do not show up anywhere.

Dim vTemp As String 'Declaring variable here
vTemp = DLookup("Nz[Currency01]", "QryPrinAmt")
Me![Currency01] = vTemp

The subform is bound and the field (Currency01) is part of the data source.
Any help would be appreciated.
 
V

viper

I need a way to prompt the user for a piece of information that will populate a text box on a subform. I thought I could prompt a field in a query which then could fill the box. There is only one (1) field in the query with a prompt of "Enter the current princple amount". The prompt shows up andthe user is able to type the info in the prompt however the results do notshow up anywhere.



Dim vTemp As String 'Declaring variable here

vTemp = DLookup("Nz[Currency01]", "QryPrinAmt")

Me![Currency01] = vTemp



The subform is bound and the field (Currency01) is part of the data source. Any help would be appreciated.

Thanks Doug, that fixed the issue I was having. I needed to prompt the user for an amount whose entry would affect several other fields in the subform before the user saw the whole form. Thanks again!!!!
 

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