Changing procedure to allow for alphanumeric field

Kully121

New Member
Joined
Sep 21, 2004
Messages
44
Private Sub cmdAddProducts_Click()


Hi,

I have the following procedure to add new products to a sub form

However i now want to change the Cust.No field to text, how do i make the relevant changes to the below to allow numbers of text or both in the Cust.No field??


DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

Dim CustNo As Long
Me.Customer_Number.SetFocus
CustNo = Me.Customer_Number.Value

Call AddProducts(CustNo)

Me.sfrmProductDiscounts.SetFocus
Me.sfrmProductDiscounts.Requery


End Sub


Thanks
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I'm not 100% sure as you haven't included the code for the AddProducts routine.

Perhaps you can just change this declaration.
Code:
Dim CustNo As Long

to
Code:
Dim CustNo As String
 
Upvote 0

Forum statistics

Threads
1,221,860
Messages
6,162,479
Members
451,769
Latest member
adyapratama

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top