InputBox

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

Hi;

Need to create an "InputBox" that populates a control in a report.

For example:

On the report opening an InputBox appears stating: Enter Name of Company.

The company name typed into the InputBox would then appear in the txtCoName
Control.

Checked Access Help, VBA Help and Access Support and 2 1,000 plus page books
and can't find an example.

This can't be rare. Can someone point me in the right direction?

Andy
 
Try (not tested)

In a module:
Public IBoxCo as string

In the onOpen event of Report

IBoxCo = inputbox("Enter Company Name)

In the onFormat event of the report header (or whereever your txtCoName
control is)
Me.txtCoName.Value = ibox

HTH
 
Hi;

Need to create an "InputBox" that populates a control in a report.

For example:

On the report opening an InputBox appears stating: Enter Name of Company.

The company name typed into the InputBox would then appear in the txtCoName
Control.

Checked Access Help, VBA Help and Access Support and 2 1,000 plus page books
and can't find an example.

This can't be rare. Can someone point me in the right direction?

Andy

No InputBox or coding needed.

Simply set the control source property of the [txtCoName] control to:
=[What Company?]

You will get a prompt for the name when the report is run.
 
Newbie;

Thank You.

Tried the code. The inputbox opens correctly but what is entered is not
displayed in the control.

Can You offer a little more help?

Andy
 
Fred/Newbie;

Thank You.

Fred's answer worked correctly. Control Source: =[Enter Company Nmae]
Parameter Box opens and the text that is entered into the parameter appears
in the control of the report.

Thank You to Both.

Andy

fredg said:
Hi;

Need to create an "InputBox" that populates a control in a report.

For example:

On the report opening an InputBox appears stating: Enter Name of Company.

The company name typed into the InputBox would then appear in the txtCoName
Control.

Checked Access Help, VBA Help and Access Support and 2 1,000 plus page books
and can't find an example.

This can't be rare. Can someone point me in the right direction?

Andy

No InputBox or coding needed.

Simply set the control source property of the [txtCoName] control to:
=[What Company?]

You will get a prompt for the name when the report is run.
 
Back
Top