Run-time error '-2147352571 (80020005)': could not set the value property. type mismatch

ch0ngz

New Member
Joined
Jun 3, 2015
Messages
1
Hi everyone,

I am having a issue with a VBA im trying out for a inventory list.

So, i need to enter/scan the article ID into the aID.value and vlookup will extract the require information.
And if i have some items receive today, i will need to enter the qty in the qtyr.value.
and after i click the cmdInbound, the data is save in the worksheet, but will gives me the above mention error.

please help.




Private Sub aID_Afterupdate()


If WorksheetFunction.CountIf(Sheets("Item List").Range("A:A"), aID.Value) = 0 Then
MsgBox "This is an incorrect Article ID"
Me.aID.Value = ""
Else


With Me


.Desc.Value = Application.VLookup(aID.Value, Sheets("Item List").Range("A:F"), 3, False) <----this is where the debug shows the error
.Qtyl.Value = Application.VLookup(aID.Value, Sheets("Item List").Range("A:F"), 4, False)
.manu.Value = Application.VLookup(aID.Value, Sheets("Item List").Range("A:F"), 6, False)


End With
End If


Me.time.Value = Now
time = Format(time.Value, "H:MM AM/PM")
Me.date1.Value = Now
date1 = Format(date1.Value, "dd-mm-yy")


End Sub
Private Sub cmdInbound_Click()


Dim lRow As Long
Dim ws As Worksheet
Set ws = Worksheets("In-Bound")
lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
With ws
.Cells(lRow, 1).Value = Me.aID.Value
.Cells(lRow, 2).Value = Me.Desc.Value
.Cells(lRow, 3).Value = Me.qtyr.Value
.Cells(lRow, 4).Value = Me.date1.Value
End With

MsgBox "Item has been successfully added"
Me.aID.Value = ""
Me.Desc.Value = ""
Me.Qtyl.Value = ""
Me.qtyr.Value = ""
Me.Qtyu.Value = ""
Me.manu.Value = ""
Me.mID.Value = ""
Me.restock.Value = ""
Me.time.Value = ""
Me.date1.Value = ""
Me.comm.Value = ""
Me.aID.SetFocus


End Sub
Private Sub UserForm_Click()


End Sub
 
Last edited:

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Forum statistics

Threads
1,203,205
Messages
6,054,136
Members
444,703
Latest member
pinkyar23

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