Two questions

  • Thread starter Thread starter Steven M. Britton
  • Start date Start date
S

Steven M. Britton

1st - I have a form that shows customer information (Name,
address, phone, etc.) I have a field that I want to use
as a notes box, however it is limited to 255 char. Is
there a way around this or does anyone out there have an
idea of what I might want to do. I have mine, but I
wantedt to hear yours.

2nd - Is it possible to have a msgbox with a
buttons "OK", "Add" and "Cancel" then if the user
clicked "Add" it would open a different form for them to
add the information. And if so can you explain to me how
to do that?


-Steven M. Britton
 
1st - I have a form that shows customer information (Name,
address, phone, etc.) I have a field that I want to use
as a notes box, however it is limited to 255 char. Is
there a way around this or does anyone out there have an
idea of what I might want to do. I have mine, but I
wantedt to hear yours.

Use a Memo field rather than a Text field - this lets you type in up
to 32,768 characters (or up to a billion if you use code to fill it).
2nd - Is it possible to have a msgbox with a
buttons "OK", "Add" and "Cancel" then if the user
clicked "Add" it would open a different form for them to
add the information. And if so can you explain to me how
to do that?

Yes, if you don't mind slightly different wording; use the MsgBox
*function* in VBA code:

Dim iAns As Integer
iAns = MsgBox("Your message", vbYesNoCancel)
Select Case iAns
Case vbYes
<do something>
Case vbNo
<do something else>
Case vbCancel
<do that>
End Select

The "do something" to open a form would use the OpenForm method - see
the VBA online help for details.
 
Steven M. Britton said:
1st - I have a form that shows customer information (Name,
address, phone, etc.) I have a field that I want to use
as a notes box, however it is limited to 255 char. Is
there a way around this or does anyone out there have an
idea of what I might want to do. I have mine, but I
wantedt to hear yours.

Use a memo field instead. Around 64,000 characters allowed through the
GUI.

2nd - Is it possible to have a msgbox with a
buttons "OK", "Add" and "Cancel" then if the user
clicked "Add" it would open a different form for them to
add the information. And if so can you explain to me how
to do that?

You can't control the captions on the built-in MsgBox buttons aside from
specifying which of the preset list of available buttons you want shown.
You would either have to use Yes/No/Cancel and explain which to press for
the user (not the way I would go), or build your own form to use instead of
the MsgBox. Then you can have any buttons with any captions on them you
like.

The trick with using your own form in place of a MsgBox is to open it with
the optional acDialog argument. This causes the calling code to pause just
like it does with a MsgBox. Have your three buttons hide the form rather
than close it. Your calling code will continue and on the subsequent lines
you can examine the (now hidden) form to see what the user did and then
close it. Each button would have to set something on the popup form so you
can use that to determine which button was pressed.
 
1 - You could change the data type to MEMO. It's limit is
64,000 characters. However I suggest adding a new table
with the key field, date, comment type and comment. It
seems to be cleaner when considering reports(allows for
filtering comments by date and comment type)

2 - the Add button can be done by useing the command button
wizard - FORM OPERATIONS/OPEN FORM
The cancel button would also use the command button wizard
- "RECORD OPERATIONS/UNDO RECORD
The OK button would also use the command button wizard -
"RECORD OPERATIONS/SAVE RECORD"

Good Luck

Jim
 
Back
Top