Enter Parameters using Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to do this seems to escape me:

I have a form that the user chooses from an unbound combo box of Time Frame
and all are based on calculations except one: "Enter Specific Dates" and I
want the user to input a "Start Date" and an "End Date" and that info goes
into [RP_Date] and [RP_Today] fields of a table because the reports criteria
are based on this table but I forget how to write in code, this is what I
have:

If [cmb_Time_Frame] = "Enter Specific Dates" Then
[RP_Date] = [Enter Start Date]
[RP_Today] = [Enter End Date]

but I get the runtime-error 2465 "Microsoft can't find the field "!" refered
to in your expression. I am assuming I don't have the [Enter Start Date]
right (I want this to pop up and the user enter their date they want to use
and it to go into [RP_Date] same with the End Date.

Any help would be great.

Thanks!
Stacey
 
Your question is very unclear.
First , please avoid using variable names with spaces in them (so you don't
have to use the braces [].
To get a table to update from a form you need the form controls to be bound
to the table.
Alternatively, you could have a pop-up form place the values in hidden
fields (visible property = NO) in your main form. You would have to refer to
the main form as [Forms]![MainFormName].[HiddenDateControl] since it is on a
different form.

Hope this provides some help.

Dorian
 
The words with the spaces is for the question box. Sorry to be so confusing,
hopefully this is more clear:

I guess that is what I am looking for, a pop up menu to be able to enter
dates, but can't I write this in code to make the boxes come up and the value
entered directed into the hidden field?

Thanks!

mscertified said:
Your question is very unclear.
First , please avoid using variable names with spaces in them (so you don't
have to use the braces [].
To get a table to update from a form you need the form controls to be bound
to the table.
Alternatively, you could have a pop-up form place the values in hidden
fields (visible property = NO) in your main form. You would have to refer to
the main form as [Forms]![MainFormName].[HiddenDateControl] since it is on a
different form.

Hope this provides some help.

Dorian

SMac said:
How to do this seems to escape me:

I have a form that the user chooses from an unbound combo box of Time Frame
and all are based on calculations except one: "Enter Specific Dates" and I
want the user to input a "Start Date" and an "End Date" and that info goes
into [RP_Date] and [RP_Today] fields of a table because the reports criteria
are based on this table but I forget how to write in code, this is what I
have:

If [cmb_Time_Frame] = "Enter Specific Dates" Then
[RP_Date] = [Enter Start Date]
[RP_Today] = [Enter End Date]

but I get the runtime-error 2465 "Microsoft can't find the field "!" refered
to in your expression. I am assuming I don't have the [Enter Start Date]
right (I want this to pop up and the user enter their date they want to use
and it to go into [RP_Date] same with the End Date.

Any help would be great.

Thanks!
Stacey
 
An InputBox command in Visual Basic Code is what I wanted to do.

Thanks!

SMac said:
The words with the spaces is for the question box. Sorry to be so confusing,
hopefully this is more clear:

I guess that is what I am looking for, a pop up menu to be able to enter
dates, but can't I write this in code to make the boxes come up and the value
entered directed into the hidden field?

Thanks!

mscertified said:
Your question is very unclear.
First , please avoid using variable names with spaces in them (so you don't
have to use the braces [].
To get a table to update from a form you need the form controls to be bound
to the table.
Alternatively, you could have a pop-up form place the values in hidden
fields (visible property = NO) in your main form. You would have to refer to
the main form as [Forms]![MainFormName].[HiddenDateControl] since it is on a
different form.

Hope this provides some help.

Dorian

SMac said:
How to do this seems to escape me:

I have a form that the user chooses from an unbound combo box of Time Frame
and all are based on calculations except one: "Enter Specific Dates" and I
want the user to input a "Start Date" and an "End Date" and that info goes
into [RP_Date] and [RP_Today] fields of a table because the reports criteria
are based on this table but I forget how to write in code, this is what I
have:

If [cmb_Time_Frame] = "Enter Specific Dates" Then
[RP_Date] = [Enter Start Date]
[RP_Today] = [Enter End Date]

but I get the runtime-error 2465 "Microsoft can't find the field "!" refered
to in your expression. I am assuming I don't have the [Enter Start Date]
right (I want this to pop up and the user enter their date they want to use
and it to go into [RP_Date] same with the End Date.

Any help would be great.

Thanks!
Stacey
 
Back
Top