Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linking fields from one form to the next. 1

Status
Not open for further replies.

gobble

Technical User
Mar 21, 2002
28
GB
I have a form with four pages on it, on one page I have a memo field which allows the user to type in a lengthy description, however this should automatically populate a summary description field (max 500 characters) on the next page. Which I was able to do. However, when I have entered in 500 or more characters on the first page I want a message to appear to inform me that I will have to summarize on the next page. And to allow me to change the entry in the summary description without change what has been entered on the first page. I have been trying to accomplish this for days so any help would be most appreciated. Thanks
 
Gobble....

In the After_Update event of the text box bound to the memo field.....

If Len(NameOfTextBox) <= 500 Then
NameOfSummaryTextBox = NameOfTextBox
Else
Msgbox &quot;Text is over 500 characters long. You will need to summarise&quot;, vbOKOnly + vbInformation, &quot;Summary required&quot;
NameOfSummaryTextBox.SetFocus
End If

Hope that helps.

Craig
 
You could also ask if the first 500 characters would be of help, if the answer is yes put them in? Sandy
 
Thanks Craig! That worked a treat!

You wouldn't know how to restrict a memo field to 500 characters?

Cheers
 
Gobble,

Either do a running count using the On_Key_Press event.....

Or.....

Have a Before_Update event

I prefer the before update....so....

If Len(NameOfYourTextField) > 500 Then
MsgBox &quot;Your summary is too long. Please reduce by &quot; & Len(NameOfYourTextField) - 500 & &quot; characters&quot;, vbOKOnly & vbInformation, &quot;Text too long&quot;
Cancel = True
End If

The Cancel = True stops the future events stop the update happening.....

Help?

Craig
 
Gobble,

Either do a running count using the On_Key_Press event.....

Or.....

Have a Before_Update event

I prefer the before update....so....

If Len(NameOfYourTextField) > 500 Then
MsgBox &quot;Your summary is too long. Please reduce by &quot; & Len(NameOfYourTextField) - 500 & &quot; characters&quot;, vbOKOnly & vbInformation, &quot;Text too long&quot;
Cancel = True
End If

The Cancel = True stops the update happening.....

Help?

Craig
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top