Userform For VLookup Search and Edit

Makpo

New Member
Joined
Sep 23, 2011
Messages
28
Hi,

Am new to vba and I need help the userform I just created to edit my table similar to a search. I already have a userform that populates this datatable.

1. On the userform (frmEdit), the combobox has a drop down with the Products but I dont know how to get the textboxes to populate with the PartID, Location, Date and Quantity of the Product I selected from the drop down and also to edit them assuming an error was enter to the data from my first userform (frmProd). I have shown the table below


PartID Products Location Date Qty
12345 Door Store4 23-Sep-11 15
12365 Eject knob Store1 24-Sep-11 50
12360 Blank cap Store2 24-Sep-11 100
12380 Screw caps Store5 24-Sep-11 50

2. I wanted to use a date and time format in my first userform (frmProd) but it comes up with the error message. Here is my code;

frmProd.txtDate.Value = Format(Date, "ddd dd/mm/yyyy", "hh:mm")

:rofl:

Am tired of guessing. LoL! Pls help with both 1 and 2
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
If your ComboBox has a RowSource you can use ListIndex + 1 on that range - offsetting it to get the right column.

Should be:

frmProd.txtDate.Value = Format(Date, "ddd dd/mm/yyyy hh:mm")
 
Upvote 0
Oh Thanks,

but for this date format its not a combobox its an empty textbox that appears automatically with the date display when the userfrom is opened. I have gotten that far, but the format keeps coming up filling the textbox with;

Sat 24/09/2011 00:00
instead of
Sat 24/09/2011 13:00
which is my timezone
 
Upvote 0
Thanks, I tried it but it didnt work, I guess am doing it wrongly.

Thanks for the help. I will settle for date only without the time option for now;

Me.txtDate.Value = Format(Date, "ddd dd/mm/yyyy")

Any hope with No.1 question?

:banghead:
 
Upvote 0
Thanks guys!

Norie you did it. Thanks Now instead of Date with the format option as shown below;

frmProd.txtDate.Value = Format(Now, "ddd dd/mm/yyyy hh:mm")

No.2 is sorted. You're a star!
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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